1 31 package org.objectweb.proactive.core.body.message; 32 33 import org.objectweb.proactive.core.UniqueID; 34 35 46 public class MessageImpl implements Message, java.io.Serializable { 47 48 49 protected String methodName; 50 51 52 protected UniqueID sourceID; 53 54 55 protected long sequenceNumber; 56 57 58 protected transient long timeStamp; 59 60 protected boolean isOneWay; 61 62 protected long sessionID; 63 64 protected boolean ciphered; 65 69 76 public MessageImpl(UniqueID sourceID, long sequenceNumber, boolean isOneWay, String methodName) { 77 this.sourceID = sourceID; 78 this.sequenceNumber = sequenceNumber; 79 this.timeStamp = System.currentTimeMillis(); 80 this.isOneWay = isOneWay; 81 this.methodName = methodName; 82 } 83 84 85 89 90 public String toString() { 91 StringBuffer sb = new StringBuffer (); 92 sb.append("method=").append(methodName).append(", "); 93 sb.append("sender=").append(sourceID).append(", "); 94 sb.append("sequenceNumber=").append(sequenceNumber).append("\n"); 95 return sb.toString(); 96 } 97 98 99 103 public UniqueID getSourceBodyID() { 104 return this.sourceID; 105 } 106 107 108 public String getMethodName() { 109 return methodName; 110 } 111 112 113 public long getSequenceNumber() { 114 return this.sequenceNumber; 115 } 116 117 118 public boolean isOneWay() { 119 return isOneWay; 120 } 121 122 123 public long getTimeStamp() { 124 return timeStamp; 125 } 126 127 128 private void readObject(java.io.ObjectInputStream s) throws java.io.IOException , ClassNotFoundException { 129 s.defaultReadObject(); 130 this.timeStamp = System.currentTimeMillis(); 131 } 132 133 134 135 } 136 | Popular Tags |