• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Singleton instance lifecycle

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

How is the lifecycle of a POJO Singleton instance managed in an app / web server. I have a Singleton class and this will be accessed by some components which are under the control of an app server. Now upon first request for this Singleton instance, the ClassLoader will load the class in memory, create an instance and is this instance retained in the memory untill the app server is brought down?
 
Rob Spoor
Sheriff
Pie
Posts: 20661
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Until the class is unloaded, which usually indeed is when the app server (or JVM for standalone apps) is shut down.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic