Chapter 2 - General EJB 3.0 Enterprise Bean Knowledge
General EJB 3.0 Enterprise Bean Knowledge
Stateless Session Bean:
• Container manages the lifecycle of the bean instance.
• Client view - bean instance exists once the client has obtained a reference to its business interface Lifecycle Callbacks for Stateless Session Beans.
Lifecycle event callbacks of stateless session beans:
Addition of a new instance to the Stateless Session Bean Pool:
Retrieving reference to Stateless Session Bean business interface from JNDI:
Servicing a business method and Removing the Stateless Session Bean instance:
Removing the Stateless Session Bean instance:
• PostConstruct callbacks occur after any dependency injection has been performed by the container and before the first business method invocation on the bean.
• PostConstruct methods are invoked in an unspecified transaction context and security context.
• PreDestroy callbacks occur at the time the bean instance is destroyed.
• PreDestroy methods execute in an unspecified transaction and security context.
Stateless Session bean in EJB