470
|
1 package alice.topology.node;
|
|
2
|
|
3 import java.util.List;
|
|
4
|
|
5 import alice.codesegment.CloseEventCodeSegment;
|
|
6 import alice.datasegment.CommandType;
|
|
7 import alice.datasegment.DataSegment;
|
|
8 import alice.datasegment.Receiver;
|
483
|
9 import alice.topology.manager.keeparive.ListManager;
|
470
|
10
|
|
11 public class DeleteConnection extends CloseEventCodeSegment {
|
|
12
|
|
13 private Receiver info = ids.create(CommandType.TAKE);
|
483
|
14 private Receiver info1 = ids.create(CommandType.TAKE);
|
470
|
15
|
|
16 public DeleteConnection() {
|
|
17 info.setKey("_CLIST");
|
507
|
18 info1.setKey("_SCHEDULER");
|
470
|
19 }
|
|
20
|
|
21 @Override
|
|
22 public void run() {
|
473
|
23 String name = getConnectionInfo().nodeName;
|
470
|
24 @SuppressWarnings("unchecked")
|
|
25 List<String> list = info.asClass(List.class);
|
|
26
|
501
|
27 if (list.contains(name))
|
470
|
28 list.remove(name);
|
501
|
29 if (DataSegment.contains(name)) {
|
|
30 DataSegment.get(name).shutdown();
|
|
31 DataSegment.remove(name);
|
478
|
32 }
|
483
|
33 ListManager manager = info1.asClass(ListManager.class);
|
|
34 manager.deleteAll(name);
|
478
|
35 ods.update(info.key, list);
|
483
|
36 ods.update(info1.key, manager);
|
470
|
37 }
|
|
38
|
|
39 }
|