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 36 37 43 public class PreDestroyLogger01 extends PreDestroyWithException00{ 44 45 48 private static JLog logger = JLogFactory.getLog(PreDestroyLogger01.class); 49 50 54 @Override 55 @PreDestroy 56 public void interceptor01(final InvocationContext ic){ 57 try { 58 super.log(ic, PRE_DESTROY, PreDestroyLogger01.class); 59 logger.debug("{0} was invoked.", CallbackType.PRE_DESTROY.toString()); 60 ic.proceed(); 61 } catch (Exception e) { 62 throw new IllegalStateException ("Exception in interceptor."); 63 } 64 } 65 66 } 67 | Popular Tags |