1 24 25 package org.objectweb.dream.protocol.utobcast.message; 26 27 import org.objectweb.dream.message.AbstractChunk; 28 import org.objectweb.dream.message.Chunk; 29 import org.objectweb.dream.message.ChunkType; 30 import org.objectweb.dream.protocol.Process; 31 32 35 public class UTOBcastChunkImpl extends AbstractChunk implements UTOBcastChunk 36 { 37 38 protected byte utoBcastMessageType = -1; 39 40 41 protected Process processFrom; 42 43 44 protected Process processTo; 45 46 47 protected long sn = -1; 48 49 55 public byte getUTOBcastMessageType() 56 { 57 return utoBcastMessageType; 58 } 59 60 63 public void setUTOBcastMessageType(byte type) 64 { 65 this.utoBcastMessageType = type; 66 } 67 68 71 public Process getProcessFrom() 72 { 73 return processFrom; 74 } 75 76 79 public void setProcessFrom(Process process) 80 { 81 this.processFrom = process; 82 } 83 84 87 public Process getProcessTo() 88 { 89 return processTo; 90 } 91 92 95 public void setProcessTo(Process process) 96 { 97 this.processTo = process; 98 } 99 100 103 public void setSequenceNumber(long sn) 104 { 105 this.sn = sn; 106 } 107 108 111 public long getSequenceNumber() 112 { 113 return sn; 114 } 115 116 120 123 public ChunkType getType() 124 { 125 return TYPE; 126 } 127 128 131 public void transfertState(Chunk newInstance) 132 { 133 ((UTOBcastChunk) newInstance) 134 .setUTOBcastMessageType(getUTOBcastMessageType()); 135 ((UTOBcastChunk) newInstance).setSequenceNumber(getSequenceNumber()); 136 ((UTOBcastChunk) newInstance).setProcessFrom(getProcessFrom()); 137 ((UTOBcastChunk) newInstance).setProcessTo(getProcessTo()); 138 } 139 140 143 public void recycle() 144 { 145 utoBcastMessageType = -1; 146 processFrom = null; 147 processTo = null; 148 sn = -1; 149 } 150 151 } | Popular Tags |