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 when the instance
is taken out of the pool of available instances to become associated
with a specific EJB object.
-
ejbLoad()
- A container invokes this method to instruct the
instance to synchronize its state by loading it state from the
underlying database.
-
ejbPassivate()
- A container invokes this method on an instance before the instance
becomes disassociated with a specific EJB object.
-
ejbRemove()
- A container invokes this method before it removes the EJB object
that is currently associated with the instance.
-
ejbStore()
- A container invokes this method 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 RemoteException
- 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: RemoteException
- Thrown if the instance could not perform the
function requested by the container because of a system-level error.
unsetEntityContext
public abstract void unsetEntityContext() throws RemoteException
- Unset the associated entity context. The container calls this method
before removing 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: RemoteException
- Thrown if the instance could not perform the
function requested by the container because of a system-level error.
ejbRemove
public abstract void ejbRemove() throws RemoteException, RemoveException
- A container invokes this method before it removes the EJB object
that is currently associated with the instance. This method
is invoked when a client invokes a remove 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 remove
operation.
- Throws: RemoteException
- Thrown if the instance could not perform the
function requested by the container because of a system-level error.
- Throws: RemoveException
- The enterprise Bean does not allow
destruction of the object.
ejbActivate
public abstract void ejbActivate() throws RemoteException
- A container invokes this method 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: RemoteException
- Thrown if the instance could not perform the
function requested by the container because of a system-level error.
ejbPassivate
public abstract void ejbPassivate() throws RemoteException
- A container invokes this method on an 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: RemoteException
- Thrown if the instance could not perform the
function requested by the container because of a system-level error.
ejbLoad
public abstract void ejbLoad() throws RemoteException
- A container invokes this method 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: RemoteException
- Thrown if the instance could not perform the
function requested by the container because of a system-level error.
ejbStore
public abstract void ejbStore() throws RemoteException
- A container invokes this method 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: RemoteException
- Thrown if the instance could not perform the
function requested by the container because of a system-level error.
All Packages Class Hierarchy This Package Previous Next Index