jQuery in Action, 2nd edition*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes distinguishing between Naming and Registry Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "distinguishing between Naming and Registry" Watch "distinguishing between Naming and Registry" New topic
Author

distinguishing between Naming and Registry

Dmitri Christo
Ranch Hand

Joined: Jan 19, 2007
Posts: 81
Hi, I would rather not post this to the distributed programming section because it has to do with my scjd assignment.

I have noticed that Naming and Registry (interface) have the same methods (like rebind and lookup), except the methods of Naming are static. Is there a specific benefit if I acquire a reference to the registry when registering my remote object?

I have seen (for example in Andrew's book) two different, but similar methods when registering:

and,


I think they are doing pretty much the same thing, but wondering what the subtle differences are between the two approaches, and when to favor one over the other.

Also, when a client does a lookup it is almost always like this:

..but would this be exactly the same as calling the following?:

where "r" is a reference to the Registry, and Registry has a lookup method.
Does it make any significant different which approach one takes?

Many thanks for any clarification.
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Originally posted by Dmitri Christo:


and,




The way I see it.. Registry, is itself a Remote Object. You can create Registry, and bind it into the rmiregistry. YOu can then create some complex structures of Registries...

The Naming and LocateRegistry are just the objects you use to retrieve the first level Registry, but Registry is more..

Check this out: http://www.j2medev.com/ebook/ShowSoftDown.asp?UrlID=1&SoftID=707
Go to page 264 (14.3)

I hope this is legal, I found it with simple Google search...

Regards,
Alex
[ February 14, 2008: Message edited by: Alex Belisle Turcot ]
Dmitri Christo
Ranch Hand

Joined: Jan 19, 2007
Posts: 81
Hi,

thanks Alex for the great resource. That chapter seems like it is giving a reasonable explanation for this. Still, I am not entirely sure about when to chose an approach for practical use.

For the purposes of this assignment however, I would say it is OK to just use Naming and LocateRegistry, since we probably don't want to do anything more with a reference to a Registry object. Would you agree with that?

Have you perhaps used these two approaches for different reasons in your assignment?

Thanks again
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Originally posted by Dmitri Christo:
Hi,

thanks Alex for the great resource. That chapter seems like it is giving a reasonable explanation for this. Still, I am not entirely sure about when to chose an approach for practical use.

For the purposes of this assignment however, I would say it is OK to just use Naming and LocateRegistry, since we probably don't want to do anything more with a reference to a Registry object. Would you agree with that?

Have you perhaps used these two approaches for different reasons in your assignment?

Thanks again


For me, they are exactly the same for this assignment, you'll only ever have a single level.. That is my understanding.

I didn't think about this really during my assignment..

Regards,
Alex
Dmitri Christo
Ranch Hand

Joined: Jan 19, 2007
Posts: 81
Thanks.

That's true. I probably shouldn't make a big issue out of it. Should be straightforward.
 
Don't get me started about those stupid light bulbs.
 
subject: distinguishing between Naming and Registry
 
Similar Threads
About JTable
The new I/O API
RMI Binding on localhost
How to create unique Client ID
how to get Clients CPU information on Server using Java RMI