Mercurial > hg > Database > Alice
view src/main/java/alice/topology/node/CloseRemoteDataSegment.java @ 518:fc313323c53b dispose
add reconnect event
author | sugi |
---|---|
date | Thu, 22 Jan 2015 16:01:32 +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); } }