1 25 package org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.sbinterface; 26 27 import java.rmi.RemoteException ; 28 29 import javax.ejb.EJB ; 30 import javax.ejb.EJBException ; 31 import javax.ejb.Remote ; 32 import javax.ejb.Remove ; 33 import javax.ejb.SessionBean ; 34 import javax.ejb.SessionContext ; 35 import javax.ejb.Stateful ; 36 37 import org.objectweb.easybeans.tests.common.ejbs.base.ItfCheck02; 38 import org.objectweb.easybeans.tests.common.ejbs.base.ItfOneMethod01; 39 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType; 40 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.BaseInsertCallbackEvent; 41 42 47 @Stateful (name = "SFSBSessionBeanItf") 48 @Remote (ItfCheck02.class) 49 @EJB (name = "ejb/bean00", beanName = "EJBInjectionBean", beanInterface = ItfOneMethod01.class) 50 public class SFSBSessionBeanItf extends BaseInsertCallbackEvent implements SessionBean , ItfCheck02 { 51 52 55 private static final long serialVersionUID = 1L; 56 57 60 private SessionContext ctx; 61 62 67 public void ejbActivate() throws EJBException , RemoteException { 68 super.log(SFSBSessionBeanItf.class.getName(), CallbackType.POST_ACTIVATE, 70 SFSBSessionBeanItf.class.getName()); 71 } 72 73 78 public void ejbPassivate() throws EJBException , RemoteException { 79 super.log(SFSBSessionBeanItf.class.getName(), CallbackType.PRE_PASSIVATE, 81 SFSBSessionBeanItf.class.getName()); 82 } 83 84 89 public void ejbRemove() throws EJBException , RemoteException { 90 super.log(SFSBSessionBeanItf.class.getName(), CallbackType.PRE_DESTROY, 91 SFSBSessionBeanItf.class.getName()); 92 } 93 94 100 public void setSessionContext(final SessionContext ctx) throws EJBException , RemoteException { 101 this.ctx = ctx; 102 } 103 104 108 public void check() throws Exception { 109 if (ctx != null) { 110 ItfOneMethod01 bean = (ItfOneMethod01) ctx.lookup("ejb/bean00"); 111 bean.getBool(); 112 } else { 113 throw new Exception ("SessionContext should be initialized."); 114 } 115 } 116 117 120 @Remove 121 public void remove() { 122 } 123 124 } 125 | Popular Tags |