Mercurial > hg > Database > Alice
view src/main/java/alice/topology/node/CloseRemoteDataSegment.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 | 28627bb3eeda |
children | 0832af83583f 767d93626b88 3284428f525e |
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.manager.keeparive.ListManager; public class CloseRemoteDataSegment extends CodeSegment { private Receiver info = ids.create(CommandType.TAKE); private Receiver info1 = ids.create(CommandType.TAKE); private Receiver info2 = ids.create(CommandType.TAKE); private Receiver info3 = ids.create(CommandType.TAKE); public CloseRemoteDataSegment() { info.setKey("_CLOSEMESSEAGE"); info1.setKey("_CLOSEREADY"); info2.setKey("_CLOSEREADY"); info3.setKey("_SCHEDULER"); } @Override public void run() { String managerKey = info.asString(); ListManager manager = info3.asClass(ListManager.class); if (info1.from.equals(managerKey)||info2.from.equals(managerKey)) { if (DataSegment.contains(managerKey)) DataSegment.get(managerKey).shutdown(); manager.deleteAll(managerKey); } ods.update(info3.key, manager); new ReceiveCloseMessage(CommandType.PEEK); } }