1 25 package org.objectweb.easybeans.tests.common.interceptors.lifecycle.postconstruct; 26 27 import javax.annotation.PostConstruct; 28 import javax.interceptor.InvocationContext; 29 30 import org.objectweb.easybeans.log.JLog; 31 import org.objectweb.easybeans.log.JLogFactory; 32 import org.objectweb.easybeans.tests.common.ejbs.base.ItfCheckPostConstruct; 33 34 35 40 public class PostConstruct00 { 41 42 45 private JLog logger = JLogFactory.getLog(PostConstruct00.class); 46 47 51 @PostConstruct 52 public void interceptor(final InvocationContext ic){ 53 logger.debug("PostConstruct was invoked."); 54 try { 55 if (ic.getTarget() instanceof ItfCheckPostConstruct && ic.getMethod() == null){ 56 ((ItfCheckPostConstruct) ic.getTarget()).setStatus(true); 57 } 58 ic.proceed(); 59 } catch (Exception e) { 60 logger.debug("Exception: {0}", e.toString()); 61 throw new IllegalStateException ("Exception in " + PostConstruct00.class.getName()); 62 } 63 } 64 65 } 66 | Popular Tags |