1 25 26 package org.objectweb.easybeans.tests.enhancer.interceptors.lifecycle.bean; 27 28 import javax.annotation.PostConstruct; 29 import javax.annotation.PreDestroy; 30 import javax.ejb.Stateless ; 31 import javax.interceptor.Interceptors; 32 33 37 @Stateless (name = "HelloWorldbean") 38 @Interceptors(MyLifeCycleInterceptorStateless.class) 39 public class StatelessBean extends AbsSessionBean implements SessionBeanItf { 40 41 44 private int counter = 0; 45 46 47 50 @PostConstruct 51 public void increment() { 52 counter++; 53 } 54 55 56 59 @PreDestroy 60 public void decrement() { 61 counter--; 62 } 63 64 65 68 public int getCounter() { 69 return counter; 70 } 71 72 } 73 | Popular Tags |