1 7 package org.jboss.tutorial.interceptor.bean; 8 9 import javax.ejb.MessageDriven ; 10 import javax.ejb.AroundInvoke; 11 import javax.ejb.InvocationContext; 12 import javax.ejb.ActivationConfigProperty ; 13 import javax.jms.Message ; 14 import javax.jms.MessageListener ; 15 16 @MessageDriven (activateConfig = 17 { 18 @ActivationConfigProperty (propertyName="destinationType", propertyValue="javax.jms.Queue"), 19 @ActivationConfigProperty (propertyName="destination", propertyValue="queue/tutorial/example") 20 }) 21 public class EmailMDB implements MessageListener 22 { 23 public void onMessage(Message recvMsg) 24 { 25 System.out.println("----------------"); 26 System.out.println("Got message, sending email"); 27 System.out.println("----------------"); 28 } 30 31 @AroundInvoke 32 public Object mdbInterceptor(InvocationContext ctx) throws Exception 33 { 34 System.out.println("*** EmailMDB.mdbInterceptor intercepting"); 35 return ctx.proceed(); 36 } 37 } 38 | Popular Tags |