1 22 package org.jboss.ejb3.test.strictpool; 23 24 import org.jboss.annotation.ejb.PoolClass; 25 import org.jboss.logging.Logger; 26 27 import javax.ejb.MessageDriven ; 28 import javax.ejb.ActivationConfigProperty ; 29 import javax.jms.MessageListener ; 30 import javax.jms.Message ; 31 32 38 @MessageDriven (activationConfig = 39 { 40 @ActivationConfigProperty (propertyName="destinationType", propertyValue="javax.jms.Queue"), 41 @ActivationConfigProperty (propertyName="destination", propertyValue="queue/queueC") 42 }) 43 @PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=1, timeout=500) 44 public class StrictlyPooledMDB2 implements MessageListener 45 { 46 private static final Logger log = Logger.getLogger(StrictlyPooledMDB2.class); 47 48 public void onMessage(Message message) 49 { 50 try 51 { 52 log.info("PROCESSING!!!!!"); 53 Thread.sleep(2000); 54 CounterBean.count++; 55 } 56 catch (InterruptedException e) 57 { 58 throw new RuntimeException (e); 59 } 60 61 } 62 } 63 | Popular Tags |