• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Instance of Singleton pattern

 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/
 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose below is my code for Singleton class. Then what will happen?

 
Muhammad Khojaye
Ranch Hand
Posts: 449
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As already been told above, each JVM will have its own Singleton instance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic