This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

UnicastRemoteObject class and Remote Interface

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ......??
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!!)
 
This guy is skipping without a rope. At least, that's what this tiny ad said:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic