- A stateless session bean instance’s life starts when the container invokes the newInstance method on the session bean class to create a new session bean instance.
- Next, the container performs any dependency injection as specified by metadata annotations on the bean class or by the deployment descriptor.
- The container then calls the PostConstruct lifecycle callback interceptor methods for the bean, if any.
- The container can perform the instance creation at any time.
- The session bean instance is now ready to be delegated a business method call from any client or a call from the container to a timeout callback method.
- When the container no longer needs the instance (usually when the container wants to reduce the number of instances in the method-ready pool), the container invokes the PreDestroy lifecycle callback interceptor methods for it, if any. This ends the life of the stateless session bean instance.
Stateless Session Bean Lifecycle2016-10-182016-10-19https://ibytecode.com/ibcjupiter/wp-content/uploads/2024/04/logo-full-small.pngiByteCode Technologieshttps://ibytecode.com/ibcjupiter/wp-content/uploads/2016/10/java-ee.png200px200px