Enetrprice Java Bean - bean life cycles

Stateless session bean - life cycle



uncreted state -> active state (setSession() from container and ejbCreate() )
active state -> destroy state (ejbRemove())


Statefull session bean - life cycle

Uncreated state -> Active state (setSession() from container and ejbCreate() )
Active state -> Passive state (ejbPassivate() )
Passive state -> Active state (ejbActivate() , bean can only be invoked when active )
Active state -> Destroy state (ejbRemove() )

Entity bean - life cycle


Uncreated -> Pool state (setEntityContext(), Now entity bean is just created and in a pool. No id is assigned)
Pool state -> Active (create(), ejbActivate(), ejbCreate(). Now it has an id)
Active state -> Pooled state (ejbPassivate(), remove(), ejbRemove() )
Active state -> destroy state (unsetEntityContext())

Message driven bean - life cycle

Uncreated -> Active state (setEntityContext()ejbCreate())
Active state -> Event listening state (onMessage(), bean can react to incoming events to now )
Active state -> destroy state (ejbRemove())
Share:

0 comments: