aspose file tools*
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
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: 234
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: 2510
    
  10

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: 234
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/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Instance of Singleton pattern