File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Distributed Java and the fly likes Small Question on UnicastRemoteObject Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Small Question on UnicastRemoteObject" Watch "Small Question on UnicastRemoteObject" New topic

Small Question on UnicastRemoteObject

Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
In context of RMI
The static method UnicastRemoteObject.exportObject exports the supplied remote object to receive incoming remote method invocations on an anonymous TCP port and returns the stub for the remote object to pass to clients. As a result of the exportObject call, the runtime may begin to listen on a new server socket or may use a shared server socket to accept incoming remote calls for the remote object.

Could anyone please tell me the the meaning of Shared here ?


University of Florida
Nitesh Kant

Joined: Feb 25, 2007
Posts: 1638

This simply means that the RMI runtime may choose to have a single server socket (essentially the port) to receive requests for multiple exported object.
At runtime, since both the stubs on client and server side are RMI specific, so RMI can safely pass information as to whether the socket is shared and if shared, which server object does a request must go.

apigee, a better way to API!
I agree. Here's the link:
subject: Small Question on UnicastRemoteObject
It's not a secret anymore!