1 22 package org.jboss.test.mdb.bean; 23 24 import javax.ejb.MessageDrivenBean ; 25 import javax.ejb.MessageDrivenContext ; 26 import javax.ejb.EJBException ; 27 28 import javax.jms.MessageListener ; 29 import javax.jms.Message ; 30 38 39 public class TXTimeOutBean implements MessageDrivenBean , MessageListener { 40 41 org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(getClass()); 42 43 long PROCESSING_DELAY = 10; 45 public void setMessageDrivenContext(MessageDrivenContext ctx) {} 46 public void ejbCreate() {} 47 public void ejbRemove() {} 48 49 public void onMessage(Message message) { 50 try { 51 log.debug("Simulating "+PROCESSING_DELAY+" second(s) of message processing "); 52 Thread.sleep(PROCESSING_DELAY*1000); 53 log.debug("Message processing simulation done."); 54 } catch (Throwable ignore) {} 55 } 56 } 57 58 59 | Popular Tags |