package fr.dgac.ivy ; import java.lang.Thread; import java.net.*; import java.io.*; import java.util.*; import org.apache.regexp.*; class Puppet { // the mapping between Ghost regexp and local bus regexp numbers Hashtable bound = new Hashtable(); // ghostID localID Hashtable regexps = new Hashtable(); // ghostID textRegexp String domain; String appName; ProxyClient pc; String id; boolean started; PuppetIvy bus; Puppet(ProxyClient pc,String id,String domain) { this.domain=domain; this.pc=pc; this.id=id; } void sendGhost(String s) { pc.send("ForwardGhost id="+id+" buffer="+s); } class ForwardMessenger implements IvyMessageListener { String localId,ghostId; public ForwardMessenger(String ghostId,String re) throws IvyException { this.ghostId=ghostId; this.localId = (new Integer(bus.bindMsg(re,ForwardMessenger.this))).toString(); bound.put(ghostId,localId); } public void receive(IvyClient ic,String args[]) { String tosend = IvyClient.Msg+" "+ghostId+IvyClient.StartArg; for (int i=0;i