1 25 26 package org.objectweb.easybeans.examples.messagedrivenbean; 27 28 import javax.interceptor.AroundInvoke; 29 import javax.interceptor.InvocationContext; 30 31 35 public class MessageDrivenInterceptor { 36 37 43 @SuppressWarnings ("finally") 44 @AroundInvoke 45 public Object handleMessage(final InvocationContext invocationContext) throws Exception { 46 System.out.println("Before receiving message"); 47 Object returnedValue = null; 48 try { 49 returnedValue = invocationContext.proceed(); 50 } finally { 51 System.out.println("After receiving message"); 52 } 53 return returnedValue; 54 } 55 } 56 | Popular Tags |