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 33 38 public class PostConstruct01 { 39 40 43 private JLog logger = JLogFactory.getLog(PostConstruct01.class); 44 45 49 @PostConstruct 50 public void interceptor(final InvocationContext ic){ 51 try { 52 if (ic.proceed() != null) { 53 throw new Exception ("The previous interceptor method is void and the proceed should return null."); 54 } 55 } catch (Exception e) { 56 logger.debug("Exception: {0}", e.toString()); 57 throw new IllegalStateException ("Exception in " + PostConstruct01.class.getName()); 58 } 59 logger.debug("PostConstruct executed."); 60 } 61 } 62 | Popular Tags |