annotate src/main/java/christie/topology/manager/keepalive/CreateTask.java @ 121:8949d0ecf1f6

refactor Topology
author akahori
date Tue, 11 Dec 2018 15:46:09 +0900
parents 2c22b23fa725
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 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
89
2c22b23fa725 update refactor
akahori
parents: 49
diff changeset
7 import java.util.ArrayList;
49
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
89
2c22b23fa725 update refactor
akahori
parents: 49
diff changeset
11 ArrayList<String> _CLIST;
49
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 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
30 }