annotate src/main/java/christie/topology/node/PrepareToClose.java @ 49:fd944876257b

add node and keepalive
author akahori
date Thu, 23 Aug 2018 09:29:05 +0900
parents
children 76b6da075ce0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
1 package christie.topology.node;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
2
fd944876257b add node and keepalive
akahori
parents:
diff changeset
3
fd944876257b add node and keepalive
akahori
parents:
diff changeset
4 import christie.annotation.Peek;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
5 import christie.annotation.Take;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
6 import christie.codegear.CodeGear;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
7 import christie.codegear.CodeGearManager;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
8
fd944876257b add node and keepalive
akahori
parents:
diff changeset
9 import java.util.List;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
10
fd944876257b add node and keepalive
akahori
parents:
diff changeset
11 public class PrepareToClose extends CodeGear {
fd944876257b add node and keepalive
akahori
parents:
diff changeset
12
fd944876257b add node and keepalive
akahori
parents:
diff changeset
13 @Peek
fd944876257b add node and keepalive
akahori
parents:
diff changeset
14 String _CLOSEMESSEAGE;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
15
fd944876257b add node and keepalive
akahori
parents:
diff changeset
16 @Take
fd944876257b add node and keepalive
akahori
parents:
diff changeset
17 List<String> _CLIST;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
18
fd944876257b add node and keepalive
akahori
parents:
diff changeset
19
fd944876257b add node and keepalive
akahori
parents:
diff changeset
20 public PrepareToClose() {
fd944876257b add node and keepalive
akahori
parents:
diff changeset
21
fd944876257b add node and keepalive
akahori
parents:
diff changeset
22 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
23
fd944876257b add node and keepalive
akahori
parents:
diff changeset
24 @Override
fd944876257b add node and keepalive
akahori
parents:
diff changeset
25 protected void run(CodeGearManager cgm) {
fd944876257b add node and keepalive
akahori
parents:
diff changeset
26 /*
fd944876257b add node and keepalive
akahori
parents:
diff changeset
27 if (_CLIST.contains(_CLOSEMESSEAGE)) {
fd944876257b add node and keepalive
akahori
parents:
diff changeset
28 _CLIST.remove(_CLOSEMESSEAGE);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
29
fd944876257b add node and keepalive
akahori
parents:
diff changeset
30 DataSegmentManager manager = DataSegment.get(_CLOSEMESSEAGE);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
31 manager.setSendError(false);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
32
fd944876257b add node and keepalive
akahori
parents:
diff changeset
33 ods.put(_CLOSEMESSEAGE, "_CLOSEREADY", _CLOSEMESSEAGE);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
34 ods.put("_CLOSEREADY", _CLOSEMESSEAGE);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
35
fd944876257b add node and keepalive
akahori
parents:
diff changeset
36 new CloseRemoteDataSegment();
fd944876257b add node and keepalive
akahori
parents:
diff changeset
37 } else {
fd944876257b add node and keepalive
akahori
parents:
diff changeset
38 // lost node is this node's parent, so already removed
fd944876257b add node and keepalive
akahori
parents:
diff changeset
39 new ReceiveCloseMessage(CommandType.TAKE);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
40 }*/
fd944876257b add node and keepalive
akahori
parents:
diff changeset
41 cgm.setup(new PrepareToClose());
fd944876257b add node and keepalive
akahori
parents:
diff changeset
42 getLocalDGM().put("_CLIST", _CLIST);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
43
fd944876257b add node and keepalive
akahori
parents:
diff changeset
44 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
45
fd944876257b add node and keepalive
akahori
parents:
diff changeset
46 }