Mercurial > hg > Database > Alice
view src/main/java/alice/topology/node/ConfigurationFinish.java @ 518:fc313323c53b dispose
add reconnect event
author | sugi |
---|---|
date | Thu, 22 Jan 2015 16:01:32 +0900 |
parents | 9e69b5c6fe44 |
children | 145c425db88d |
line wrap: on
line source
package alice.topology.node; import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; import alice.topology.manager.keeparive.StartKeepAlive; public class ConfigurationFinish extends CodeSegment { public Receiver reverseCount = ids.create(CommandType.PEEK); public Receiver configNodeNum = ids.create(CommandType.PEEK); private CodeSegment startCS; public ConfigurationFinish(CodeSegment startCS) { this.startCS = startCS; } @Override public void run() { int rcount = reverseCount.asInteger(); int ncount = configNodeNum.asInteger(); if (rcount == ncount) { ods.put("manager", "done", ValueFactory.createNilValue()); Start cs = new Start(startCS); cs.done.setKey("manager", "start"); cs.config.setKey("TNConfig"); cs.reconnect.setKey("reconnect"); new StartKeepAlive().execute(); new ReceiveCloseMessage(CommandType.PEEK); ClosedEventManager.getInstance().register(DeleteConnection.class); ClosedEventManager.getInstance().setKey(); return; } ConfigurationFinish cs3 = new ConfigurationFinish(startCS); cs3.reverseCount.setKey("local", "reverseCount", this.reverseCount.index); cs3.configNodeNum.setKey("local", "configNodeNum"); } }