Mercurial > hg > Members > tatsuki > Alice
view src/alice/topology/node/IncomingConnectionInfo.java @ 33:20c67f673224
change name of DataSegmentReceiver
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 18 Jan 2012 01:34:23 +0900 |
parents | 2bfb796b0fa1 |
children | ca079a730d0b |
line wrap: on
line source
package alice.topology.node; import java.io.IOException; import org.msgpack.MessagePack; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.DataSegment; import alice.datasegment.Receiver; import alice.topology.HostMessage; public class IncomingConnectionInfo extends CodeSegment { public Receiver hostInfo = ids.create(CommandType.TAKE); private String absName; private int count; public IncomingConnectionInfo(String absName, int count) { this.absName = absName; this.count = count; } @Override public void run() { if (this.hostInfo.val == null) { ods.put("local", "configNodeNum", count); return; } MessagePack msgpack = new MessagePack(); try { HostMessage hostInfo = msgpack.convert(this.hostInfo.val, HostMessage.class); DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); //manager.put("reverseKey", ValueFactory.createRawValue(hostInfo.reverseName)); ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); } catch (IOException e) { e.printStackTrace(); } IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, ++count); cs.hostInfo.setKey("manager", absName); } }