Mercurial > hg > Database > Alice
view src/main/java/alice/topology/node/DeleteConnection.java @ 587:4d38c71938f5 dispose
change ConfigrationFinish
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 30 Jan 2016 20:31:06 +0900 (2016-01-30) |
parents | 28627bb3eeda |
children | 0832af83583f 767d93626b88 |
line wrap: on
line source
package alice.topology.node; import java.util.List; import alice.codesegment.CloseEventCodeSegment; import alice.datasegment.CommandType; import alice.datasegment.DataSegment; import alice.datasegment.Receiver; import alice.topology.manager.keeparive.ListManager; public class DeleteConnection extends CloseEventCodeSegment { private Receiver info = ids.create(CommandType.TAKE); private Receiver info1 = ids.create(CommandType.TAKE); public DeleteConnection() { info.setKey("_CLIST"); info1.setKey("_SCHEDULER"); } @Override public void run() { String name = getConnectionInfo().nodeName; @SuppressWarnings("unchecked") List<String> list = info.asClass(List.class); if (list.contains(name)) list.remove(name); if (DataSegment.contains(name)) { DataSegment.get(name).shutdown(); DataSegment.remove(name); } ListManager manager = info1.asClass(ListManager.class); manager.deleteAll(name); ods.update(info.key, list); ods.update(info1.key, manager); } }