Mercurial > hg > Database > Alice
view src/alice/topology/node/IncomingConnectionInfo.java @ 216:21bd8af1cf26 working
change asClass method
author | one |
---|---|
date | Wed, 27 Mar 2013 19:38:33 +0900 |
parents | fec0726bb126 |
children | 7f7b3506bff9 |
line wrap: on
line source
package alice.topology.node; 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.getVal() == null) { ods.put("local", "configNodeNum", count); return; } HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, ++count); cs.hostInfo.setKey("manager", absName); } }