1 2 3 package Jt; 4 import java.util.*; 5 import java.lang.reflect.*; 6 import java.beans.*; 7 import java.io.*; 8 9 12 13 public class JtMediator extends JtComposite { 14 15 16 public JtMediator () { 17 } 18 19 20 21 28 29 30 public Object processMessage (Object message) { 31 32 String msgid = null; 33 JtMessage e = (JtMessage) message; 34 Object content; 35 Object data; 36 37 38 if (e == null) 39 return null; 40 41 msgid = (String ) e.getMsgId (); 42 43 if (msgid == null) 44 return null; 45 46 content = e.getMsgContent(); 47 data = e.getMsgData (); 48 49 if (msgid.equals ("JtREMOVE")) { 51 return (this); 52 } 53 54 56 return (super.processMessage (message)); 57 58 } 59 60 61 64 65 public static void main(String [] args) { 66 67 JtObject main = new JtFactory (); 68 69 JtMediator mediator; 70 71 73 mediator = (JtMediator) main.createObject ("Jt.JtMediator", "mediator"); 74 75 76 main.removeObject ("mediator"); 77 78 79 } 80 81 } 82 83 84 | Popular Tags |