annotate src/main/java/christie/topology/manager/keepalive/CreateTask.java @ 49:fd944876257b

add node and keepalive
author akahori
date Thu, 23 Aug 2018 09:29:05 +0900
parents
children 2c22b23fa725
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 import christie.annotation.Peek;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
4 import christie.codegear.CodeGear;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
5 import christie.codegear.CodeGearManager;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
6
fd944876257b add node and keepalive
akahori
parents:
diff changeset
7 import java.util.List;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
8
fd944876257b add node and keepalive
akahori
parents:
diff changeset
9 public class CreateTask extends CodeGear{
fd944876257b add node and keepalive
akahori
parents:
diff changeset
10 @Peek
fd944876257b add node and keepalive
akahori
parents:
diff changeset
11 List<String> _CLIST;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
12 @Peek
fd944876257b add node and keepalive
akahori
parents:
diff changeset
13 ListManager _SCHEDULER;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
14
fd944876257b add node and keepalive
akahori
parents:
diff changeset
15 public static int INTERVAL = 5;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
16
fd944876257b add node and keepalive
akahori
parents:
diff changeset
17 public CreateTask(){
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 @Override
fd944876257b add node and keepalive
akahori
parents:
diff changeset
21 protected void run(CodeGearManager cgm){
fd944876257b add node and keepalive
akahori
parents:
diff changeset
22 int i = INTERVAL;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
23 for (String manager : _CLIST){
fd944876257b add node and keepalive
akahori
parents:
diff changeset
24 TaskInfo task = new TaskInfo(TaskType.PING);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
25 task.setInfo(manager, "_FORM_"+manager, i * 1000);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
26 _SCHEDULER.addTask(task);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
27 i +=INTERVAL;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
28 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
29 getLocalDGM().put("_SCHEDULER", _SCHEDULER);
fd944876257b add node and keepalive
akahori
parents:
diff changeset
30
fd944876257b add node and keepalive
akahori
parents:
diff changeset
31 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
32 }