aboutsummaryrefslogtreecommitdiff
path: root/src/Ghost.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ghost.java')
-rw-r--r--src/Ghost.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Ghost.java b/src/Ghost.java
index ad6e78c..fd7465d 100644
--- a/src/Ghost.java
+++ b/src/Ghost.java
@@ -22,18 +22,21 @@ class Ghost extends IvyClient {
super(bus,socket,remotePort,incoming);
this.id=id;
this.pc=pc;
+ System.out.println("new Ghost: "+id+" pc:"+pc);
}
+ // ProxyClient -> Ghost -> Ivy Bus
protected synchronized void sendBuffer( String buffer ) throws IvyException {
- System.out.println("out buffer: "+buffer);
- pc.forward(id,buffer);
- super.sendBuffer(buffer);
+ // System.out.println("out buffer: "+buffer+" for:"+pc+" id:"+id);
+ super.sendBuffer(buffer); // and to all the agents on the Ghost bus ? I'm not sure
}
+ // Bus -> Ghost -> ProxyClient -> ProxyMaster -> other buses
protected boolean newParseMsg(String s) throws IvyException {
- System.out.println("in buffer: "+s);
- pc.forward(id,buffer);
- return super.newParseMsg(s);
+ // I received a message from an agent on the bus
+ System.out.println("in buffer to forward from "+id+": "+s);
+ if (pc!=null) pc.forward(id,s); // forward to all the puppets
+ return super.newParseMsg(s); // I'll take no action
}
}