Mercurial > hg > Database > Alice
comparison src/alice/topology/manager/keeparive/TaskExecuter.java @ 321:7de56e995f09
minor change
author | one |
---|---|
date | Tue, 17 Dec 2013 18:54:47 +0900 |
parents | aafc88985822 |
children | 4b5bf9cf1505 |
comparison
equal
deleted
inserted
replaced
320:aafc88985822 | 321:7de56e995f09 |
---|---|
1 package alice.topology.manager.keeparive; | 1 package alice.topology.manager.keeparive; |
2 | 2 |
3 import alice.codesegment.CodeSegment; | 3 import alice.codesegment.CodeSegment; |
4 import alice.datasegment.CommandType; | 4 import alice.datasegment.CommandType; |
5 import alice.datasegment.DataSegment; | |
5 import alice.datasegment.Receiver; | 6 import alice.datasegment.Receiver; |
6 | 7 |
7 public class TaskExecuter extends CodeSegment{ | 8 public class TaskExecuter extends CodeSegment{ |
8 private Receiver info = ids.create(CommandType.TAKE); | 9 private Receiver info = ids.create(CommandType.TAKE); |
9 private TaskInfo nowTask; | 10 private TaskInfo nowTask; |
38 } catch (InterruptedException e) {} | 39 } catch (InterruptedException e) {} |
39 } | 40 } |
40 if (interruptFlag){ | 41 if (interruptFlag){ |
41 interruptFlag = false; | 42 interruptFlag = false; |
42 } else { | 43 } else { |
43 ods.ping(nowTask.getManagerKey(), nowTask.getReturnKey()); | 44 if (nowTask.getType() == TaskType.PING) { |
44 new RespondPing(nowTask.getReturnKey()); | 45 ods.ping(nowTask.getManagerKey(), nowTask.getReturnKey()); |
46 new RespondPing(nowTask.getReturnKey()); | |
47 } else { | |
48 DataSegment.get(nowTask.getManagerKey()).close(); | |
49 } | |
50 | |
45 } | 51 } |
52 nowTask = null; | |
46 setKey(); | 53 setKey(); |
47 } | 54 } |
48 public synchronized void interrupt(){ | 55 public synchronized void interrupt(){ |
49 interruptFlag = true; | 56 interruptFlag = true; |
50 notify(); | 57 notify(); |