e hënë, 18 qershor 2007

Life cycle methods of Stateful Session Bean

Stateful Session Bean
------------------------------------
11111) does not exist --> bean is does not exist state
a) create() --> a bean instance is created
b) setSessionContext() --> instanciates the bean object
c) ejbCreate() --> allows to perform operations after the bean instance created and before it starts processing request like create database connection.
*****Dest****> READY STATE

22222) Ready
a) ejbRemove() --> to perform certain operations before bean object is removed or garbage collected. e.g. close database connection.
b) remove() --> removes the bean instance or makes it ready for garbage collection.
*****Dest****> DOES NOT EXIST STATE

c) ejbPassivate() --> called before bean performs passivation operation on bean instance, stores bean info from memory to secondary storage (like virtual memory for ideal apps in OS) based on least-recently-used algorithm.
*****Dest****> PASSIVE STATE

33333) Passive
a) ejbActivate() --> when any business method of a bean is invoked while bean is in passive state, ejb container activates the bean, moves back to ready stage and then calls ejbActivate() method.
*****Dest****> READY STATE

Nuk ka komente: