Mercurial > hg > Database > Alice
view src/main/java/alice/topology/node/ConfigurationFinish.java @ 587:4d38c71938f5 dispose
change ConfigrationFinish
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 30 Jan 2016 20:31:06 +0900 |
parents | 145c425db88d |
children | 3284428f525e |
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; private int topMNumber; public ConfigurationFinish(CodeSegment startCS, int topMNum) { this.startCS = startCS; this.topMNumber = topMNum; } @Override public void run() { int rcount = reverseCount.asInteger(); int ncount = configNodeNum.asInteger(); if (rcount == ncount) { ods.put("manager"+topMNumber, "done", ValueFactory.createNilValue()); if (topMNumber == 1){ Start cs = new Start(startCS); cs.done.setKey("manager"+topMNumber, "start"); new StartKeepAlive().execute(); new ReceiveCloseMessage(CommandType.PEEK); ClosedEventManager.getInstance().register(DeleteConnection.class); ClosedEventManager.getInstance().setKey(); } return; } ConfigurationFinish cs3 = new ConfigurationFinish(startCS, topMNumber); cs3.reverseCount.setKey("local", "reverseCount", this.reverseCount.index); cs3.configNodeNum.setKey("local", "configNodeNum"); } }