IntelliJ Java IDE
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Singleton Design Pattern in RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Singleton Design Pattern in RMI" Watch "Singleton Design Pattern in RMI" New topic
Author

Singleton Design Pattern in RMI

Rudy Yeung
Ranch Hand

Joined: Dec 27, 2000
Posts: 183
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?
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 2547
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


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
Rudy Yeung
Ranch Hand

Joined: Dec 27, 2000
Posts: 183
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
 
IntelliJ Java IDE
 
subject: Singleton Design Pattern in RMI
 
Threads others viewed
how to make single instance of a class?
about default constructor
Singleton Pattern Design in RMI Server
newInstance()
final Objects .....
MyEclipse, The Clear Choice