Class AbstractStatelessSessionBean
java.lang.Object
com.onenetwork.platform.tools.ejb.AbstractStatelessSessionBean
public abstract class AbstractStatelessSessionBean
extends java.lang.Object
You generally should not need to use EJBs in platform applications; this is provided
primarily for backward compatibility. To control transactions from REST resources, see
BaseResource
. From server-side code, see TransactionSupport
.
Base class for stateless session beans. Modules may define stateless session beans
in order to leverage container-managed database transactions.
Platform uses EJB2 Stateless Session Beans for transaction management. You can add new
stateless session beans to your Module by using the following conventions:
- Name the class using the convention
*Bean
, for exampleRegistrationBean
- Place the bean in the
server
package of your module (or a subpackage), for examplecom.mycompany.mymodule.server.RegistrationBean
- Add XDoclet tags to define bean attributes such as transaction policy/etc. Each new Module is created with a
SampleAccessorBean
which you can use as a reference.
build/gen-src
directory of your module.
If you navigate to that directory, you will see five classes generated for a
class such as SampleAccessorBean
:
- SampleAccessor - Remote interface
- SampleAccessorHome - Remote Home interface
- SampleAccessorLocal - Local interface
- SampleAccessorLocalHome - Local Home interface
- SampleAccessorUtil - Utility class for acquiring Remote and Local Home
-
Field Summary
Fields Modifier and Type Field Description protected javax.ejb.SessionContext
ctx
EJB session context, available to subclasses -
Constructor Summary
Constructors Constructor Description AbstractStatelessSessionBean()
-
Method Summary
Modifier and Type Method Description void
ejbActivate()
Default implementation does nothing.void
ejbCreate()
Default implementation does nothing.void
ejbPassivate()
Default implementation does nothing.void
ejbRemove()
Default implementation does nothing.void
setSessionContext(javax.ejb.SessionContext ctx)
-
Field Details
-
ctx
protected javax.ejb.SessionContext ctxEJB session context, available to subclasses
-
-
Constructor Details
-
AbstractStatelessSessionBean
public AbstractStatelessSessionBean()
-
-
Method Details
-
ejbActivate
public void ejbActivate() throws javax.ejb.EJBException, java.rmi.RemoteExceptionDefault implementation does nothing.- Throws:
javax.ejb.EJBException
java.rmi.RemoteException
-
ejbPassivate
public void ejbPassivate() throws javax.ejb.EJBException, java.rmi.RemoteExceptionDefault implementation does nothing.- Throws:
javax.ejb.EJBException
java.rmi.RemoteException
-
ejbRemove
public void ejbRemove() throws javax.ejb.EJBException, java.rmi.RemoteExceptionDefault implementation does nothing.- Throws:
javax.ejb.EJBException
java.rmi.RemoteException
-
setSessionContext
public void setSessionContext(javax.ejb.SessionContext ctx) throws javax.ejb.EJBException, java.rmi.RemoteException- Throws:
javax.ejb.EJBException
java.rmi.RemoteException
-
ejbCreate
public void ejbCreate() throws javax.ejb.CreateExceptionDefault implementation does nothing.- Throws:
javax.ejb.EJBException
java.rmi.RemoteException
javax.ejb.CreateException
-