Professional Documents
Culture Documents
Singleton
Singleton
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 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.
1 of 1 8/18/2023, 7:36 PM