annotate src/fdl/MetaLogEngine.java @ 122:ad73eacf560a default tip

remove warning
author e095732
date Thu, 07 Feb 2013 22:32:26 +0900
parents 0ea086f0e96f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
1 package fdl;
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
2
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
3 import java.nio.ByteBuffer;
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
4
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
5 /**
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
6 * @author kono
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
7 * Meta Protocol Engine for each Linda Server
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
8 */
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
9
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
10 public class MetaLogEngine implements MetaEngine {
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
11 MetaLinda meta;
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
12 boolean running = true;
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
13 CommDebugHook commDebug;
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
14
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
15 public MetaLogEngine(MetaLinda meta) {
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
16 this.meta = meta;
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
17 }
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
18
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
19 PSXCallback monitor_callback_start =
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
20 new PSXCallback() {public void callback(ByteBuffer reply) {
37
2a366abc3f1f *** empty log message ***
kono
parents: 36
diff changeset
21 meta.setTupleSpaceHook(commDebug = new CommDebugHook());
33
64071f8e2e0d *** empty log message ***
kono
parents: 31
diff changeset
22 meta.out(PSX.META_MONITOR_DATA, null);
21
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
23 meta.in(PSX.META_MONITOR,monitor_callback);
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
24 }};
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
25 PSXCallback monitor_callback =
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
26 new PSXCallback() {public void callback(ByteBuffer reply) {
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
27 ByteBuffer data;
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
28 do {
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
29 data = commDebug.getLog();
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
30 if (data!=null) break;
97
0ea086f0e96f main loop modification, for easy meta engine addition.
one
parents: 37
diff changeset
31 meta.sync(0);
36
d5bca4b5ee95 meta.sync() recursive call fix.
kono
parents: 33
diff changeset
32 } while (running);
d5bca4b5ee95 meta.sync() recursive call fix.
kono
parents: 33
diff changeset
33 if (running) {
d5bca4b5ee95 meta.sync() recursive call fix.
kono
parents: 33
diff changeset
34 meta.out(PSX.META_MONITOR_DATA, data);
d5bca4b5ee95 meta.sync() recursive call fix.
kono
parents: 33
diff changeset
35 meta.in(PSX.META_MONITOR,monitor_callback);
d5bca4b5ee95 meta.sync() recursive call fix.
kono
parents: 33
diff changeset
36 }
21
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
37 }};
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
38
97
0ea086f0e96f main loop modification, for easy meta engine addition.
one
parents: 37
diff changeset
39 public void mainLoop(MetaLinda meta) {
21
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
40 meta.in(PSX.META_MONITOR,monitor_callback_start);
31
846c6c14cf04 worked?
kono
parents: 23
diff changeset
41 meta.in(PSX.META_STOP, new PSXCallback() {public void callback(ByteBuffer reply) {
846c6c14cf04 worked?
kono
parents: 23
diff changeset
42 running = false;}});
21
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
43 while(running)
97
0ea086f0e96f main loop modification, for easy meta engine addition.
one
parents: 37
diff changeset
44 meta.sync(0);
21
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
45 }
fac6e0073b1a *** empty log message ***
kono
parents:
diff changeset
46 }