1 22 package org.jboss.ejb3.test.mdb; 23 24 import javax.ejb.ActivationConfigProperty ; 25 import javax.ejb.MessageDriven ; 26 import javax.ejb.MessageDrivenContext ; 27 import javax.jms.Message ; 28 import javax.jms.MessageListener ; 29 30 import javax.annotation.security.RunAs; 31 import javax.annotation.Resource; 32 33 import org.jboss.annotation.ejb.DefaultActivationSpecs; 34 import org.jboss.annotation.security.SecurityDomain; 35 import org.jboss.logging.Logger; 36 37 43 @DefaultActivationSpecs({ 44 @ActivationConfigProperty (propertyName="destinationType", propertyValue="javax.jms.Queue") 45 }) 46 @MessageDriven (activationConfig = 47 { 48 @ActivationConfigProperty (propertyName="destination", propertyValue="queue/defaultedmdbtest") 49 }) 50 @RunAs("TestRole") 51 @SecurityDomain("other") 52 public class DefaultedQueueTestMDB implements MessageListener 53 { 54 private static final Logger log = Logger.getLogger(DefaultedQueueTestMDB.class); 55 56 @Resource MessageDrivenContext ctx; 57 58 public void onMessage(Message recvMsg) 59 { 60 System.out.println("*** DefaultedQueueTestMDB onMessage"); 61 if (ctx == null) throw new RuntimeException ("FAILED ON CTX LOOKUP"); 62 TestStatusBean.defaultedQueueRan++; 63 } 64 } 65 | Popular Tags |