| Author |
Singleton instance lifecycle
|
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
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?
|
SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Until the class is unloaded, which usually indeed is when the app server (or JVM for standalone apps) is shut down.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Monu Tripathi
Rancher
Joined: Oct 12, 2008
Posts: 1365
|
|
|
Even I asked this question once!
|
[List of FAQs] | [Android FAQ] | [My Blog] | [Samuh Varta]
|
 |
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
|
Thanks for the information.
|
 |
 |
|
|
subject: Singleton instance lifecycle
|
|
|