Mercurial > hg > Members > tatsuki > Alice
changeset 322:4b5bf9cf1505
minor change
author | one |
---|---|
date | Tue, 17 Dec 2013 19:46:29 +0900 |
parents | 7de56e995f09 |
children | d746c4486287 |
files | src/alice/topology/manager/keeparive/CreateTask.java src/alice/topology/manager/keeparive/TaskExecuter.java src/alice/topology/manager/keeparive/TaskInfo.java |
diffstat | 3 files changed, 17 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/topology/manager/keeparive/CreateTask.java Tue Dec 17 18:54:47 2013 +0900 +++ b/src/alice/topology/manager/keeparive/CreateTask.java Tue Dec 17 19:46:29 2013 +0900 @@ -14,7 +14,7 @@ } @Override - public void run() { + public void run(){ ods.put("_WAITINGLIST", new ListManager()); @SuppressWarnings("unchecked") List<String> list = info.asClass(List.class);
--- a/src/alice/topology/manager/keeparive/TaskExecuter.java Tue Dec 17 18:54:47 2013 +0900 +++ b/src/alice/topology/manager/keeparive/TaskExecuter.java Tue Dec 17 19:46:29 2013 +0900 @@ -13,7 +13,7 @@ private static TaskExecuter instance = new TaskExecuter(); private TaskExecuter(){} - public static TaskExecuter getInstance() { + public static TaskExecuter getInstance(){ return instance; } @@ -23,7 +23,7 @@ } @Override - public synchronized void run() { + public synchronized void run(){ ListManager list = info.asClass(ListManager.class); if (list.getTaskList().size() == 0){ ods.update("_WAITINGLIST", list); @@ -36,13 +36,16 @@ if (nowTask.getSleepTime()!=0){ try { this.wait(nowTask.getSleepTime()); - } catch (InterruptedException e) {} + } catch (InterruptedException e){} } if (interruptFlag){ interruptFlag = false; } else { - if (nowTask.getType() == TaskType.PING) { + if (nowTask.getType() == TaskType.PING){ ods.ping(nowTask.getManagerKey(), nowTask.getReturnKey()); + TaskInfo task = new TaskInfo(TaskType.CLOSE); + task.setInfo(nowTask.getManagerKey(), 60 * 1000); + ods.put("_TASKINFO", task); new RespondPing(nowTask.getReturnKey()); } else { DataSegment.get(nowTask.getManagerKey()).close(); @@ -57,7 +60,7 @@ notify(); } - public TaskInfo getNowTask() { + public TaskInfo getNowTask(){ return nowTask; }
--- a/src/alice/topology/manager/keeparive/TaskInfo.java Tue Dec 17 18:54:47 2013 +0900 +++ b/src/alice/topology/manager/keeparive/TaskInfo.java Tue Dec 17 19:46:29 2013 +0900 @@ -10,13 +10,18 @@ type = t; } + public void setInfo(String managerKey, long time){ + this.managerKey = managerKey; + sleepTime = time; + } + public void setInfo(String managerKey, String returnKey, long time){ this.managerKey = managerKey; this.returnKey = returnKey; sleepTime = time; } - public TaskType getType() { + public TaskType getType(){ return type; } @@ -28,11 +33,11 @@ sleepTime = time; } - public String getManagerKey() { + public String getManagerKey(){ return managerKey; } - public String getReturnKey() { + public String getReturnKey(){ return returnKey; } }