1 24 25 package org.objectweb.dream.protocol; 26 27 import java.io.Externalizable ; 28 import java.io.IOException ; 29 import java.io.ObjectInput ; 30 import java.io.ObjectOutput ; 31 32 import org.objectweb.dream.message.AbstractChunk; 33 import org.objectweb.dream.message.Chunk; 34 import org.objectweb.dream.message.ChunkType; 35 36 40 public class ArrowChunkImpl extends AbstractChunk 41 implements 42 ArrowChunk, 43 Chunk, 44 Externalizable 45 { 46 47 private short processFrom; 48 private short processTo; 49 50 54 57 public short getProcessIdFrom() 58 { 59 return processFrom; 60 } 61 62 65 public void setProcessIdFrom(short from) 66 { 67 processFrom = from; 68 } 69 70 73 public short getProcessIdTo() 74 { 75 return processTo; 76 } 77 78 81 public void setProcessIdTo(short to) 82 { 83 processTo = to; 84 } 85 86 90 93 public ChunkType getType() 94 { 95 return ArrowChunk.TYPE; 96 } 97 98 101 public void recycle() 102 { 103 } 104 105 108 public void transfertState(Chunk newInstance) 109 { 110 ArrowChunk newInst = (ArrowChunk) newInstance; 111 newInst.setProcessIdFrom(getProcessIdFrom()); 112 newInst.setProcessIdTo(getProcessIdTo()); 113 } 114 115 119 122 public void readExternal(ObjectInput in) throws IOException , 123 ClassNotFoundException 124 { 125 processFrom = in.readShort(); 126 processTo = in.readShort(); 127 } 128 129 132 public void writeExternal(ObjectOutput out) throws IOException 133 { 134 out.writeShort(processFrom); 135 out.writeShort(processTo); 136 } 137 138 } | Popular Tags |