1 package Jt.examples.jms; 2 3 import Jt.*; 4 import Jt.jms.*; 5 import java.io.*; 6 7 8 10 public class JMSAsyncReceiver { 11 12 13 14 15 17 public static void main(String [] args) { 18 19 JtFactory main = new JtFactory (); JtMessage msg; 21 String greeting; 22 String reply; 23 Jt.jms.JtJMSQueueAdapter jmsAdapter; 24 JtEcho echo = new JtEcho (); 25 JtKeyboard keyboard = new JtKeyboard (); 26 27 28 30 jmsAdapter = (Jt.jms.JtJMSQueueAdapter) main.createObject 31 ("Jt.jms.JtJMSQueueAdapter", "jmsAdapter"); 32 33 35 main.setValue (jmsAdapter, "subject", echo); 36 main.sendMessage (jmsAdapter, new JtMessage ("JtSTART_LISTENING")); 37 38 39 System.out.println ("Listening for asynchronous messages ... "); 40 41 main.sendMessage (keyboard, new JtMessage ("JtACTIVATE")); 42 43 44 46 main.removeObject ("jmsAdapter"); 47 48 49 50 } 51 52 } 53 54 55 56 | Popular Tags |