Meaningless Drivel is fun!*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Instance of Singleton pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Instance of Singleton pattern" Watch "Instance of Singleton pattern" New topic
Author

Instance of Singleton pattern

Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229
Hi All,

If I have a distributed architecture with load balancing and clustering feature and I have used Singleton patterns then how many object of that Singleton class will be across this application with multiple servers.

Thanks in Advance,
Kousik
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

How did you implement the Singleton?
It can be one per class loader, one per jvm, one per server, or more

Have a read at this article:
http://java.sun.com/developer/technicalArticles/Programming/singletons/


OCUP UML fundamental and ITIL foundation
youtube channel
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229
Suppose below is my code for Singleton class. Then what will happen?

Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

As already been told above, each JVM will have its own Singleton instance.


http://muhammadkhojaye.blogspot.com/
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Instance of Singleton pattern
 
Similar Threads
Singleton in SWING
Singleton Question
Doubt with a singleton class
Generic Singleton Class
Singleton Factory Object