1 22 package org.jboss.ejb3.test.dd.mdb; 23 24 import javax.ejb.MessageDrivenBean ; 25 import javax.ejb.MessageDrivenContext ; 26 import javax.ejb.EJBException ; 27 28 import javax.jms.JMSException ; 29 import javax.jms.MessageListener ; 30 import javax.jms.Message ; 31 32 40 41 public class TXTimeOutBean implements MessageDrivenBean , MessageListener 42 { 43 44 org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(getClass()); 45 46 long PROCESSING_DELAY = 10; 48 public void setMessageDrivenContext(MessageDrivenContext ctx) 49 { 50 } 51 52 public void ejbCreate() 53 { 54 } 55 56 public void ejbRemove() 57 { 58 } 59 60 public void onMessage(Message message) 61 { 62 try 63 { 64 log.debug("Simulating " + PROCESSING_DELAY + " second(s) of message processing "); 65 TestStatusBean.addDestination(message.getJMSDestination()); 66 Thread.sleep(PROCESSING_DELAY * 1000); 67 log.debug("Message processing simulation done."); 68 } 69 catch (Throwable ignore) 70 { 71 } 72 } 73 } 74 | Popular Tags |