1 25 package org.objectweb.easybeans.tests.common.ejbs.mdb.containermanaged.transaction; 26 27 import javax.ejb.ActivationConfigProperty ; 28 import javax.ejb.EJB ; 29 import javax.ejb.MessageDriven ; 30 import javax.ejb.TransactionAttribute ; 31 import javax.ejb.TransactionAttributeType ; 32 import javax.jms.Message ; 33 import javax.jms.MessageListener ; 34 35 import org.objectweb.easybeans.log.JLog; 36 import org.objectweb.easybeans.log.JLogFactory; 37 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType; 38 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.BaseInsertCallbackEvent; 39 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.inheritance.ItfCMTInheritance; 40 import org.objectweb.easybeans.tests.common.jms.JMSManager; 41 42 48 @MessageDriven (activationConfig = { 49 @ActivationConfigProperty (propertyName = "destination", propertyValue = JMSManager.DEFAULT_QUEUE), 50 @ActivationConfigProperty (propertyName = "destinationType", propertyValue = "javax.jms.Queue"), 51 @ActivationConfigProperty (propertyName = "messageSelector", propertyValue = 52 "TYPE = 'org.objectweb.easybeans.tests.common.ejbs.mdb.containermanaged.transaction.MDBCMTNotSupported'")}) 53 @TransactionAttribute (TransactionAttributeType.NOT_SUPPORTED) 54 public class MDBCMTNotSupported extends BaseInsertCallbackEvent implements MessageListener { 55 56 59 public static final String MESSAGE_TYPE = "org.objectweb.easybeans.tests.common.ejbs." 60 + "mdb.containermanaged.transaction.MDBCMTNotSupported"; 61 62 65 private static JLog logger = JLogFactory.getLog(MDBCMTNotSupported.class); 66 67 70 @EJB (beanName = "SLSBCMTInheritance") 71 private ItfCMTInheritance bean; 72 73 77 public void onMessage(final Message message) { 78 try { 79 logger.debug("Invoking dummyMethod1."); 81 bean.dummyMethod1(); 82 super.log(MDBCMTNotSupported.class, CallbackType.ON_MESSAGE, MDBCMTNotSupported.class); 83 logger.debug("Invoking dummyMethod1 finished."); 84 }catch (Exception e) { 85 logger.error("Error invoking dummyMethod1. Exception = {0}", e.getCause()); 86 } 87 } 88 89 } 90 | Popular Tags |