Mercurial > hg > Database > Alice
annotate src/main/java/alice/topology/node/IncomingConnectionInfo.java @ 485:45b3fe2375ef dispose
reconnetion process will execute after disconnection event
author | sugi |
---|---|
date | Sat, 06 Dec 2014 21:10:02 +0900 |
parents | 6e304a7a60e7 |
children | b789b8459996 |
rev | line source |
---|---|
345 | 1 package alice.topology.node; |
2 | |
3 import alice.codesegment.CodeSegment; | |
4 import alice.datasegment.CommandType; | |
5 import alice.datasegment.DataSegment; | |
6 import alice.datasegment.Receiver; | |
7 import alice.topology.HostMessage; | |
8 | |
9 public class IncomingConnectionInfo extends CodeSegment { | |
10 | |
419 | 11 public Receiver hostInfo = ids.create(CommandType.TAKE); |
12 private String absName; | |
13 private int count; | |
404 | 14 |
419 | 15 public IncomingConnectionInfo(String absName, int count) { |
16 this.absName = absName; | |
17 this.count = count; | |
18 } | |
404 | 19 |
345 | 20 |
419 | 21 @Override |
22 public void run() { | |
23 if (this.hostInfo.getVal() == null) { | |
24 ods.put("local", "configNodeNum", count); | |
25 } else { | |
26 HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); | |
429 | 27 if (DataSegment.contains(hostInfo.connectionName)) { |
485
45b3fe2375ef
reconnetion process will execute after disconnection event
sugi
parents:
467
diff
changeset
|
28 // need to wait remove by DeleteConnection |
45b3fe2375ef
reconnetion process will execute after disconnection event
sugi
parents:
467
diff
changeset
|
29 ods.put("manager", absName, hostInfo); |
429 | 30 } else { |
31 ods.put("cMember", hostInfo.connectionName); | |
32 new CreateConnectionList(); | |
467 | 33 count++; |
485
45b3fe2375ef
reconnetion process will execute after disconnection event
sugi
parents:
467
diff
changeset
|
34 DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); |
45b3fe2375ef
reconnetion process will execute after disconnection event
sugi
parents:
467
diff
changeset
|
35 ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); |
467 | 36 } |
37 | |
419 | 38 } |
467 | 39 |
419 | 40 IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, count); |
41 cs.hostInfo.setKey("manager", absName); | |
42 } | |
345 | 43 |
44 } |