# HG changeset patch
# User sugi
# Date 1386646363 -32400
# Node ID f9ec5bead15056fa40fe19f89492769bc51f5fe1
# Parent f1f0638861abc1c2e2c9a00a0b4c76f148d6eb5d
come back response. but has bug
diff -r f1f0638861ab -r f9ec5bead150 .classpath
--- a/.classpath Fri Dec 06 11:42:51 2013 +0900
+++ b/.classpath Tue Dec 10 12:32:43 2013 +0900
@@ -5,7 +5,6 @@
-
diff -r f1f0638861ab -r f9ec5bead150 src/alice/topology/manager/keeparive/CreateTask.java
--- a/src/alice/topology/manager/keeparive/CreateTask.java Fri Dec 06 11:42:51 2013 +0900
+++ b/src/alice/topology/manager/keeparive/CreateTask.java Tue Dec 10 12:32:43 2013 +0900
@@ -20,7 +20,7 @@
List list = info.asClass(List.class);
new CheckExistTask();
- new GetTask();
+ SendPing.getInstance().setKey();
for (String manager : list){
int i = 5;
TaskInfo task = new TaskInfo(manager, "_RESPONCE", i * 1000);
diff -r f1f0638861ab -r f9ec5bead150 src/alice/topology/manager/keeparive/RespondPing.java
--- a/src/alice/topology/manager/keeparive/RespondPing.java Fri Dec 06 11:42:51 2013 +0900
+++ b/src/alice/topology/manager/keeparive/RespondPing.java Tue Dec 10 12:32:43 2013 +0900
@@ -14,6 +14,8 @@
@Override
public void run() {
System.out.println(respond.getVal());
+ TaskInfo task = new TaskInfo(respond.from, "_RESPONCE", 10 * 1000);
+ ods.put("_TASKINFO", task);
}
}
diff -r f1f0638861ab -r f9ec5bead150 src/alice/topology/manager/keeparive/SendPing.java
--- a/src/alice/topology/manager/keeparive/SendPing.java Fri Dec 06 11:42:51 2013 +0900
+++ b/src/alice/topology/manager/keeparive/SendPing.java Tue Dec 10 12:32:43 2013 +0900
@@ -13,14 +13,14 @@
private SendPing(){}
public static SendPing getInstance() {
- return instance;
- }
-
+ return instance;
+ }
+
public void setKey(){
ids.init();
info.setKey("_WAITINGLIST");
}
-
+
@Override
public synchronized void run() {
ListManager list = info.asClass(ListManager.class);
@@ -28,22 +28,23 @@
ods.update("_WAITINGLIST", list);
new GetTask();
return;
- }
- try {
- nowTask = list.getTaskList().pollFirst();
- ods.update("_WAITINGLIST", list);
- System.out.print("managerkey is "+ nowTask.getManagerKey());
- System.out.println(" returnkey is "+ nowTask.getReturnKey());
- time = System.currentTimeMillis();
- if (nowTask.getSleepTime()!=0)
- this.wait(nowTask.getSleepTime());
- if (interruptFlag){
- interruptFlag = false;
- } else {
- ods.ping(nowTask.getManagerKey(), nowTask.getReturnKey());
- new RespondPing(nowTask.getReturnKey());
+ } else {
+ try {
+ nowTask = list.getTaskList().pollFirst();
+ ods.update("_WAITINGLIST", list);
+ System.out.print("managerkey is "+ nowTask.getManagerKey());
+ System.out.println(" returnkey is "+ nowTask.getReturnKey());
+ time = System.currentTimeMillis();
+ if (nowTask.getSleepTime()!=0)
+ this.wait(nowTask.getSleepTime());
+ if (interruptFlag){
+ interruptFlag = false;
+ } else {
+ ods.ping(nowTask.getManagerKey(), nowTask.getReturnKey());
+ new RespondPing(nowTask.getReturnKey());
+ }
+ } catch (InterruptedException e) {
}
- } catch (InterruptedException e) {
}
new GetTask();
}
@@ -51,11 +52,11 @@
interruptFlag = true;
notify();
}
-
+
public TaskInfo getNowTask() {
return nowTask;
}
-
+
public long getTime(){
return time;
}