Mercurial > hg > Database > Alice
view src/main/java/alice/topology/node/IncomingConnectionInfo.java @ 547:e91a574b69de dispose
remove index
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 18 Aug 2015 16:15:17 +0900 |
parents | f3f7e256ee03 |
children |
line wrap: on
line source
package alice.topology.node; import alice.codesegment.CodeSegment; import alice.daemon.AliceDaemon; 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); } else { HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); if (aliceDaemon.dataSegment.contains(hostInfo.connectionName)) { // need to wait remove by DeleteConnection ods.put("manager", absName, hostInfo); } else { aliceDaemon.dataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); count++; ods.put("cMember", hostInfo.connectionName); new CreateConnectionList(); } } IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, count); cs.hostInfo.setKey("manager", absName, this); } }