aspose file tools
The moose likes Distributed Java and the fly likes UnicastRemoteObject class and Remote Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Distributed Java
Reply Bookmark "UnicastRemoteObject class and Remote Interface" Watch "UnicastRemoteObject class and Remote Interface" New topic
Author

UnicastRemoteObject class and Remote Interface

Ravi Bansal
Ranch Hand

Joined: Aug 18, 2008
Posts: 82
Hi Guys,

I m just beginner in RMI

I want to understand what is the use of extending marker interafce java.rmi.Remote ........i read that its to inform JVM that methods of this interface can be called remotely.........if this is the case then why should i extend UnicastRemoteObject(which actually extends RemoteObject) in implementing class ??? in my implementation class , it should just work by implementing the remote interface ......??


SCJP 5.0 94%
OCE-EJBD 90%
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

UnicastRemoteObject is used to export your object and make it available for remote invocations.
You may well choose not to extend UnicastRemoteObject, instead use UnicastRemoteObject.export()to export your object explicitly.
If you extend UnicastRemoteObject, you do not need to explicitly export the object, it is done implicitly when you create an instance of the object. (Wondered why the constructor throws a RemoteException!!!)


apigee, a better way to API!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: UnicastRemoteObject class and Remote Interface
 
Similar Threads
NX(URLyBird):single remote object or multi-remote object?
NX: Clients' connections
Question on Connection Object
UniCastRemoteObject
UnicastRemote class and Serializable interface