Mercurial > hg > Database > Alice
view src/main/java/alice/topology/node/IncomingConnectionInfo.java @ 621:4027e55df60d dispose current-release
add startKeepAlive
author | suruga |
---|---|
date | Sun, 06 Aug 2017 18:42:43 +0900 |
parents | 145c425db88d |
children | 0832af83583f 767d93626b88 1a860019b2fe ded89ea8861f 8f765e3eed24 8d9f35701fdb |
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); } else { HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); if (DataSegment.contains(hostInfo.connectionName)) { // need to wait remove by DeleteConnection ods.put("manager", absName, hostInfo); } else { 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); } }