• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

About extending UnicastRemoteObject!!!

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Why do we say extends UnicastRemoteObject in RMI...
I have done a RMI program without extending this class...it works perfectly.
**** What is the significance of extending this UnicastRemoteObject class..
please do reply me as soon as possible...
many thanks,
ram...
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Extending UnicastRemoteObject is not a requirement; it's just ensures that your subclass will be exported once constructed. You could just as easily code it this way:

Or for that matter, you could call exportObject() in a main().
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
Ramalingam Vijayakumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Micheal,
Thanks a lot for your reply..I never knew that something like this can be done...
What I have done in my program is
class XYZ implements RemoteSeriveInterface,Serializable {
public void serviceName() throws RemoteException { }

}
and when I register the object of the above code it registers perfectly..and it also serves as a remote object...What I am not getting till now is what is the significance of using UnicastRemoteObject ...
thanks,
ram...
 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello Ram,
Are you telling me that , without using UnicastRemoteObject.exportObject(obj), you were able to bind your
object in the registry?From your words i get an impression that
you are not using UnicastRemoteObject anywhere in your program!!
I guess that is not possible!!

Manjunath
 
Ramalingam Vijayakumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello manjunath,
I have a problem in my m/c...
when I workked with an simple RMI prog...without using UnicastRemoteObject it get's registerd with the registry [perfectly..but when I make a remote call ...it is not executing in servers m/c but instead it make a copy of the remote object and the the invocation happens only in that copy...
I do not understnad whether it is my m'c problem or not..
When I tried in some other m/c it didnt work..It throwed a exception and the time of runing the server..
anyway thanx for your reply..
bye,
ram..
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic