annotate src/main/java/christie/topology/manager/keepalive/RespondPing.java @ 111:671246274719

fix file dir
author akahori
date Tue, 20 Nov 2018 18:29:13 +0900
parents fd944876257b
children
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.manager.keepalive;
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.Take;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
5 import christie.codegear.CodeGear;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
6 import christie.codegear.CodeGearManager;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
7
fd944876257b add node and keepalive
akahori
parents:
diff changeset
8 public class RespondPing extends CodeGear{
fd944876257b add node and keepalive
akahori
parents:
diff changeset
9 @Take
fd944876257b add node and keepalive
akahori
parents:
diff changeset
10 RespondData respondData;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
11 // private long pingedTime = System.currentTimeMillis();
fd944876257b add node and keepalive
akahori
parents:
diff changeset
12
fd944876257b add node and keepalive
akahori
parents:
diff changeset
13
fd944876257b add node and keepalive
akahori
parents:
diff changeset
14 @Override
fd944876257b add node and keepalive
akahori
parents:
diff changeset
15 public void run(CodeGearManager cgm) {
fd944876257b add node and keepalive
akahori
parents:
diff changeset
16 TaskExecuter exec = TaskExecuter.getInstance();
fd944876257b add node and keepalive
akahori
parents:
diff changeset
17 synchronized (exec){
fd944876257b add node and keepalive
akahori
parents:
diff changeset
18 //System.out.print("ping from "+d.from);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
19 //System.out.println(" Recieved time "+(d.time - pingedTime));
fd944876257b add node and keepalive
akahori
parents:
diff changeset
20
fd944876257b add node and keepalive
akahori
parents:
diff changeset
21 TaskInfo task = new TaskInfo(TaskType.CLOSE);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
22 task.setInfo(respondData.from, null, 0);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
23 if (!exec.compareAndSkip(task)){
fd944876257b add node and keepalive
akahori
parents:
diff changeset
24 // case: remove task is still in the waiting queue.
fd944876257b add node and keepalive
akahori
parents:
diff changeset
25 getLocalDGM().put("_REMOVETASK",task);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
26 new RemoveTask();
fd944876257b add node and keepalive
akahori
parents:
diff changeset
27 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
28 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
29 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
30 }