All Packages Class Hierarchy This Package Previous Next Index
Interface javax.ejb.EntityBean
- public interface interface EntityBean
- extends EnterpriseBean
The EntityBean interface is implemented by every entity enterprise bean
class. The container uses the EntityBean methods to notify the enterprise
bean instances of the instance's life cycle events.
Note: Support for entity enterprise beans is optional for
EJB 1.0 compliant containers. Support for entities will become mandatory
for EJB 2.0 compliant containers.
-
ejbActivate()
- A container invokes this method on the instance when the instance
is taken out of the pool of available instances to become associated
with a specific EJB object.
-
ejbDestroy()
- A container invokes this method before it destroys the EJB object
that is currrently associated with the instance.
-
ejbLoad()
- A container invokes this method on the instance to instruct the
instance to synchronize its state by loading it state from the
underlying database.
-
ejbPassivate()
- A container invokes this method on instance before the instance
becomes disassociated with a specific EJB object.
-
ejbPostCreate()
- A container invokes this function as part of the protocol for
the creation of an EJB object.
-
ejbStore()
- A container invokes this method on the instance to instruct the
instance to synchronize its state by storing it to the underlying
database.
-
setEntityContext(EntityContext)
- Set the associated entity context.
-
unsetEntityContext()
- Unset the associated entity context.
setEntityContext
public abstract void setEntityContext(EntityContext ctx) throws EJBException
- Set the associated entity context. The container invokes this method
on an instance after the instance has been created.
This method is called in an unspecified transaction context.
- Parameters:
- ctx - An EntityContext interface for the instance. The instance
should store the reference to the context in an instance variable.
- Throws: EJBException
- Thrown if the instance could not perform the
function requested by the container.
unsetEntityContext
public abstract void unsetEntityContext() throws EJBException
- Unset the associated entity context. The container calls this method
before destroying the instance.
This is the last method that the container invokes on the instance.
The Java garbage collector will eventually invoke the finalize() method
on the instance.
This method is called in an unspecified transaction context.
- Throws: EJBException
- Thrown if the instance could not perform the
function requested by the container.
ejbPostCreate
public abstract void ejbPostCreate() throws EJBException
- A container invokes this function as part of the protocol for
the creation of an EJB object. The container calls ejbPostCreate
on the instance after it calls the appropriate ejbCreate(...) method
on the instance.
This method is called in the proper transaction context.
The EJB object identity has been established before the container
calls ejbPostCreate() and therefore the instance can, for example, pass
a reference to the EJB object to other enterprise beans in a method
argument.
- Throws: EJBException
- Thrown if the instance could not perform the
function requested by the container.
ejbDestroy
public abstract void ejbDestroy() throws EJBException, DestroyException
- A container invokes this method before it destroys the EJB object
that is currrently associated with the instance. This method
is invoked when a client invokes a destroy operation on the
enterprise bean's home interface or the EJB object's remote interface.
This method transitions the instance from the ready state to the pool
of available instances.
This method is called in the transaction context of the destroy
operation.
- Throws: EJBException
- Thrown if the instance could not perform the
function requested by the container.
- Throws: DestroyException
- The enterprise bean does not allow
destruction of the object.
ejbActivate
public abstract void ejbActivate() throws EJBException
- A container invokes this method on the instance when the instance
is taken out of the pool of available instances to become associated
with a specific EJB object. This method transitions the instance to
the ready state.
This method executes in an unspecified transaction context.
- Throws: EJBException
- Thrown if the instance could not perform the
function requested by the container.
ejbPassivate
public abstract void ejbPassivate() throws EJBException
- A container invokes this method on instance before the instance
becomes disassociated with a specific EJB object. After this method
completes, the container will place the instance into the pool of
available instances.
This method executes in an unspecified transaction context.
- Throws: EJBException
- Thrown if the instance could not perform the
function requested by the container.
ejbLoad
public abstract void ejbLoad() throws EJBException
- A container invokes this method on the instance to instruct the
instance to synchronize its state by loading it state from the
underlying database.
This method always executes in the proper transaction context.
- Throws: EJBException
- Thrown if the instance could not perform the
function requested by the container.
ejbStore
public abstract void ejbStore() throws EJBException
- A container invokes this method on the instance to instruct the
instance to synchronize its state by storing it to the underlying
database.
This method always executes in the proper transaction context.
- Throws: EJBException
- Thrown if the instance could not perform the
function requested by the container.
All Packages Class Hierarchy This Package Previous Next Index