1 25 package org.objectweb.easybeans.tests.common.interceptors.business.base; 26 27 import static org.objectweb.easybeans.tests.common.helper.InterceptorHelper.addValue; 28 29 import javax.ejb.EJB ; 30 import javax.interceptor.InvocationContext; 31 32 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType; 33 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.ItfCallbackLoggerAccess; 34 35 42 public class PrintOrderWithAllCallbackMethods { 43 44 47 @EJB (beanName = "SLSBCallbackLoggerAccess") 48 private ItfCallbackLoggerAccess clBean; 49 50 53 public static final Integer ORDER = new Integer (5); 54 55 63 public Object addOrder(final InvocationContext invocationContext) throws Exception { 64 return addValue(invocationContext, ORDER, this.getClass().toString()); 65 } 66 67 72 public void postConstruct(final InvocationContext invocationContext) throws Exception { 73 clBean.insertCallbackLogger(invocationContext.getTarget().getClass().getName(), CallbackType.POST_CONSTRUCT, 74 this.getClass().getName()); 75 invocationContext.proceed(); 76 } 77 78 83 public void preDestroy(final InvocationContext invocationContext) throws Exception { 84 clBean.insertCallbackLogger(invocationContext.getTarget().getClass().getName(), CallbackType.PRE_DESTROY, this 85 .getClass().getName()); 86 invocationContext.proceed(); 87 } 88 89 95 public void prePassivate(final InvocationContext invocationContext) throws Exception { 96 invocationContext.proceed(); 98 } 99 100 106 public void postActivate(final InvocationContext invocationContext) throws Exception { 107 invocationContext.proceed(); 109 } 110 111 } 112 | Popular Tags |