1 package test.ejb; 2 3 import javax.ejb.EJBException ; 4 import javax.ejb.MessageDrivenBean ; 5 import javax.ejb.MessageDrivenContext ; 6 import javax.jms.Message ; 7 import javax.jms.MessageListener ; 8 9 70 public class QueueBean implements MessageDrivenBean , MessageListener { 71 72 private MessageDrivenContext messageContext = null; 73 74 75 public void setMessageDrivenContext(MessageDrivenContext messageContext) throws EJBException { 76 this.messageContext = messageContext; 77 } 78 79 84 public void ejbCreate() { 85 } 87 88 89 public void ejbRemove() { 90 messageContext = null; 91 } 92 93 106 public void onMessage(Message message) { 107 System.out.println("QueueBean got message " + message); 108 } 110 111 } 112 | Popular Tags |