annotate 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
parents 28627bb3eeda
children 0832af83583f 767d93626b88
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
470
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
1 package alice.topology.node;
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
2
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
3 import java.util.List;
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
4
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
5 import alice.codesegment.CloseEventCodeSegment;
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
6 import alice.datasegment.CommandType;
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
7 import alice.datasegment.DataSegment;
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
8 import alice.datasegment.Receiver;
483
86c45738dd9e success fix topology ..... may be
sugi
parents: 478
diff changeset
9 import alice.topology.manager.keeparive.ListManager;
470
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
10
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
11 public class DeleteConnection extends CloseEventCodeSegment {
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
12
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
13 private Receiver info = ids.create(CommandType.TAKE);
483
86c45738dd9e success fix topology ..... may be
sugi
parents: 478
diff changeset
14 private Receiver info1 = ids.create(CommandType.TAKE);
470
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
15
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
16 public DeleteConnection() {
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
17 info.setKey("_CLIST");
507
28627bb3eeda refactor
sugi
parents: 501
diff changeset
18 info1.setKey("_SCHEDULER");
470
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
19 }
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
20
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
21 @Override
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
22 public void run() {
473
041ec04d4d45 refactor
sugi
parents: 471
diff changeset
23 String name = getConnectionInfo().nodeName;
470
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
24 @SuppressWarnings("unchecked")
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
25 List<String> list = info.asClass(List.class);
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
26
501
c5072a63b257 remove comment
sugi
parents: 483
diff changeset
27 if (list.contains(name))
470
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
28 list.remove(name);
501
c5072a63b257 remove comment
sugi
parents: 483
diff changeset
29 if (DataSegment.contains(name)) {
c5072a63b257 remove comment
sugi
parents: 483
diff changeset
30 DataSegment.get(name).shutdown();
c5072a63b257 remove comment
sugi
parents: 483
diff changeset
31 DataSegment.remove(name);
478
cf345b10a21a bug fix
sugi
parents: 473
diff changeset
32 }
483
86c45738dd9e success fix topology ..... may be
sugi
parents: 478
diff changeset
33 ListManager manager = info1.asClass(ListManager.class);
86c45738dd9e success fix topology ..... may be
sugi
parents: 478
diff changeset
34 manager.deleteAll(name);
478
cf345b10a21a bug fix
sugi
parents: 473
diff changeset
35 ods.update(info.key, list);
483
86c45738dd9e success fix topology ..... may be
sugi
parents: 478
diff changeset
36 ods.update(info1.key, manager);
470
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
37 }
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
38
780ae843cdac Delete disconnect managerKey from connection list
sugi
parents:
diff changeset
39 }