1 29 package jegg.impl; 30 31 import java.util.logging.Logger ; 32 33 import jegg.EggBase; 34 import jegg.Port; 35 import jegg.PortException; 36 import jegg.timer.Timer; 37 38 41 public class MessageHandlerB extends EggBase 42 { 43 public static final Logger log = Logger.getLogger(MessageHandlerB.class.getName()); 44 public Object msg = new Object (); 45 public Object response = null; 46 public Timer timer = null; 47 private String _name; 48 49 public MessageHandlerB(String s) 50 { 51 _name = s; 52 } 53 54 public void handle(Init i) 55 { 56 log.info("MessageHandlerB: looking up port for MessageHandlerA"); 57 getContext().requestPort("egg_a:Port"); 58 } 59 60 65 protected void handle(Port p) throws PortException 66 { 67 log.info("Sending message to EggClassA"); 68 p.send(getContext().createMessage(msg)); 69 } 70 71 86 public void handle(Object message) 87 { 88 log.info("EggClassB: Got response from EggClassA"); 89 response = message; 90 } 91 92 } 93 | Popular Tags |