cuba.ejb
Class EJB2Adapter

java.lang.Object
  extended by cuba.AbstractComponentAdapter
      extended by cuba.ejb.EJB2Adapter
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean
Direct Known Subclasses:
EJB2SyncAdapter

public abstract class EJB2Adapter
extends AbstractComponentAdapter
implements javax.ejb.SessionBean

Base class for generated EJB 2 adapters

Author:
Arnold Kmpaczyk
See Also:
Serialized Form

Field Summary
 
Fields inherited from class cuba.AbstractComponentAdapter
core
 
Constructor Summary
EJB2Adapter(java.lang.Object core)
           
 
Method Summary
protected  java.lang.Object _getCore()
           
 void ejbActivate()
           
 void ejbCreate()
          This methods remains empty.
 void ejbPassivate()
           
 void ejbRemove()
          This function is called on object removal and in turn calls the adapter's AbstractComponentAdapter._preDestroy() method.
protected  MethodInvocation invoker()
           
 void setSessionContext(javax.ejb.SessionContext context)
          Creates an AbstractEJBComponentContext from the passed SesssionContext
 
Methods inherited from class cuba.AbstractComponentAdapter
_initCore, _injectDependencies, _postActivate, _postConstruct, _preDestroy, _prePassivate, box, box, box, box, box, box, box, box, invoke, invoke, invokeLifecycle, runtimeException, unbox_boolean, unbox_byte, unbox_char, unbox_double, unbox_float, unbox_hort, unbox_int, unbox_long
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EJB2Adapter

public EJB2Adapter(java.lang.Object core)
Method Detail

ejbCreate

public void ejbCreate()
This methods remains empty. Methods with a @PostConstruct annotation must be executed *after* dependency injection, so function setSessionContext() will be the trigger.


ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

ejbRemove

public void ejbRemove()
This function is called on object removal and in turn calls the adapter's AbstractComponentAdapter._preDestroy() method. If _preDestroy() returns with an exception, the function determines if it is running in a TX context and rolls it back if existing, according to the EJB 3 specification.

Specified by:
ejbRemove in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext context)
                       throws javax.ejb.EJBException,
                              java.rmi.RemoteException
Creates an AbstractEJBComponentContext from the passed SesssionContext

Specified by:
setSessionContext in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

_getCore

protected java.lang.Object _getCore()
Specified by:
_getCore in class AbstractComponentAdapter

invoker

protected MethodInvocation invoker()
Specified by:
invoker in class AbstractComponentAdapter