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.Bogus") 45 }) 46 @MessageDriven (activationConfig = 47 { 48 @ActivationConfigProperty (propertyName="destination", propertyValue="queue/overridedefaultedmdbtest") 49 }) 50 @RunAs("TestRole") 51 @SecurityDomain("other") 52 public class OverrideDefaultedQueueTestMDB implements MessageListener 53 { 54 private static final Logger log = Logger.getLogger(DefaultedQueueTestMDB.class); 55 @Resource MessageDrivenContext ctx; 56 57 public void onMessage(Message recvMsg) 58 { 59 if (ctx == null) throw new RuntimeException ("FAILED ON CTX LOOKUP"); 60 System.out.println("*** OverrideDefaultedQueueTestMDB onMessage"); 61 TestStatusBean.overrideDefaultedQueueRan++; 62 } 63 } 64 | Popular Tags |