1 25 package org.objectweb.easybeans.tests.common.interceptors.lifecycle.predestroy; 26 27 import static org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType.PRE_DESTROY; 28 29 import javax.annotation.PreDestroy; 30 import javax.interceptor.InvocationContext; 31 32 import org.objectweb.easybeans.log.JLog; 33 import org.objectweb.easybeans.log.JLogFactory; 34 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType; 35 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.BaseInsertCallbackEvent; 36 37 42 public class PreDestroyLogger00 extends BaseInsertCallbackEvent { 43 44 47 private static JLog logger = JLogFactory.getLog(PreDestroyLogger00.class); 48 49 53 @PreDestroy 54 public void intercept(final InvocationContext ic) { 55 try { 56 super.log(ic, PRE_DESTROY, PreDestroyLogger00.class); 57 logger.debug("{0} was invoked.", CallbackType.PRE_DESTROY.toString()); 58 ic.proceed(); 59 } catch (Exception e) { 60 throw new IllegalStateException ("Exception in interceptor."); 61 } 62 } 63 } 64 | Popular Tags |