1 25 package org.objectweb.easybeans.tests.common.ejbs.stateless.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.SessionBean ; 33 import javax.ejb.SessionContext ; 34 import javax.ejb.Stateless ; 35 36 import org.objectweb.easybeans.tests.common.ejbs.base.ItfCheck01; 37 import org.objectweb.easybeans.tests.common.ejbs.base.ItfOneMethod01; 38 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType; 39 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.BaseInsertCallbackEvent; 40 41 46 @Stateless (name = "SLSBSessionBeanInterface00") 47 @Remote (ItfCheck01.class) 48 @EJB (name = "ejb/bean00", beanName = "EJBInjectionBean", beanInterface = ItfOneMethod01.class) 49 public class SLSBSessionBeanInterface00 extends BaseInsertCallbackEvent implements SessionBean , ItfCheck01 { 50 51 54 private static final long serialVersionUID = 1L; 55 56 59 private SessionContext ctx; 60 61 66 public void ejbActivate() throws EJBException , RemoteException { 67 } 68 69 74 public void ejbPassivate() throws EJBException , RemoteException { 75 } 76 77 82 public void ejbRemove() throws EJBException , RemoteException { 83 super.log(SLSBSessionBeanInterface00.class.getName(), CallbackType.PRE_DESTROY, 85 SLSBSessionBeanInterface00.class.getName()); 86 } 87 88 94 public void setSessionContext(final SessionContext ctx) throws EJBException , RemoteException { 95 this.ctx = ctx; 96 } 97 98 102 public void check() throws Exception { 103 if (ctx != null) { 104 ItfOneMethod01 bean = (ItfOneMethod01) ctx.lookup("ejb/bean00"); 105 bean.getBool(); 106 } else { 107 throw new Exception ("SessionContext should be initialized."); 108 } 109 } 110 111 } 112 | Popular Tags |