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.PostActivate ; 31 import javax.ejb.PrePassivate ; 32 33 34 38 39 public class AbsSessionBean implements SessionBeanItf { 40 41 44 private boolean postConstructCalled = false; 45 46 47 50 private boolean preDestroyCalled = false; 51 52 55 private int superLifeCycleCounter = 0; 56 57 58 61 public void calledPostConstruct() { 62 this.postConstructCalled = true; 63 } 64 65 68 public boolean isPostConstructCalled() { 69 return postConstructCalled; 70 } 71 72 73 76 public void calledPreDestroy() { 77 this.preDestroyCalled = true; 78 } 79 80 81 84 public boolean isPreDestroyCalled() { 85 return preDestroyCalled; 86 } 87 88 89 92 @PostConstruct 93 @PostActivate 94 public void superLifeCycleMethodIncrement() { 95 superLifeCycleCounter++; 96 } 97 98 101 @PreDestroy 102 @PrePassivate 103 public void superLifeCycleMethodDecrement() { 104 superLifeCycleCounter--; 105 } 106 107 110 public int getSuperLifeCycleCounter() { 111 return superLifeCycleCounter; 112 } 113 114 115 } 116 | Popular Tags |