Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

The Lifecycle of a Singleton Session Bean (The Java EE 6 Tutorial, Vo... https://docs.oracle.com/cd/E19226-01/820-7627/giprx/index.

html

Oracle Homeagetest
Documentation Home > The Java EE 6 Tutorial, Volume I > Part IV Enterprise Beans > Chapter 14
Enterprise Beans > The Life Cycles of Enterprise Beans > The Lifecycle of a Singleton Session Bean

The Java EE 6 Tutorial, Volume I

Previous: The Lifecycle of a Stateless Session Bean


Next: The Lifecycle of a Message-Driven Bean

The Lifecycle of a Singleton Session Bean


Like a stateless session bean, a singleton session bean is never passivated and has only two stages:
nonexistent and ready for the invocation of business methods.

Figure 14–5 Lifecycle of a Singleton Session Bean

The EJB container initiates the singleton session bean lifecycle by creating the singleton instance. This
occurs upon application deployment if the singleton is annotated with the @Startup annotation The
container performs any dependency injection and then invokes the method annotated @PostConstruct, if it
exists. The singleton session bean is now ready to have its business methods invoked by the client.

At the end of the lifecycle, the EJB container calls the method annotated @PreDestroy, if it exists. The
singleton session bean is now ready for garbage collection.

Previous: The Lifecycle of a Stateless Session Bean


Next: The Lifecycle of a Message-Driven Bean

© 2010, Oracle Corporation and/or its affiliates

Downloads Ch17.pptx 1504860721SE-MOD19-… life cycle 2.pdf 100% Clear

1 of 1 8/18/2023, 7:36 PM

You might also like