• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Singleton Design Pattern in RMI

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The RMI server requires the instantiation of a single remote object to be passed to the Naming.rebind() method. Can this be considered a singleton pattern design?
 
Enthuware Software Support
Posts: 4428
41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you can always create more than one object of the (remote) class and bind them with different names. In singleton pattern, the class itself provides a mechnism to instantiate an (and only one) object. You don't (and can't) do a new for that class (as the constructor is private), instead you do ClassName.getInstance() to get an instance of that class.
-Paul. http://www.enthuware.com/jdevplus
Your guide to SCJD!

------------------
Get Certified, Guaranteed!
(Now Revised for the new Pattern)
www.enthuware.com/jqplus

Try out the world's only WebCompiler!
www.jdiscuss.com
 
Rudy Yeung
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul,
If that is the case, can I say that the RMI server acts as a singleton agent over the FBN database? There is supposed to be only one RMI server accessing to the database in the assignment.
Rudy
 
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic