• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI and it's unknown ways

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

I was testing my application and I've discovered that after calling <b>unbind</b> and checking with <b>list</b> that the RMI registry doesn't contain the entry for my remote object, the clients can still invoke methods on the remote object at their leisure. No exceptions are thrown!!!

However, new clients get an exception (which is the right behaviour) upon trying to get a remote object.
Moreover, if I close the Server application completely than I do get the expected behaviour, the clients (new or old) will get an exception.

Now, I could close the server all the time without fancying around with <b>unbind</b> but I am afraid that I am only hiding a bigger problem; maybe my RMI approach is not the right one.

My remote object has an instance variable which is the Data class. All clients are expected to get stubs that point to the same instance of the remote object.

I am thinking that the Data class was passed somehow by copy and not by reference to the client.

Testing is done in the same JVM, on the same machine.

Any ideas on why this might happen?

Thank you all in advance,
Adrian
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

the clients can still invoke methods on the remote object at their leisure. No exceptions are thrown!!!



Don't know, still have to start with the RMI part and dive in to it. Are you sure that your classpath is not simply pointing to the remote object so that it just has access to it bypassing RMI?
 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, I am sure.
Thanks for replying.
 
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Adrian Muscalu:
Hi everyone,

I was testing my application and I've discovered that after calling <b>unbind</b> and checking with <b>list</b> that the RMI registry doesn't contain the entry for my remote object, the clients can still invoke methods on the remote object at their leisure. No exceptions are thrown!!!

However, new clients get an exception (which is the right behaviour) upon trying to get a remote object.
Moreover, if I close the Server application completely than I do get the expected behaviour, the clients (new or old) will get an exception.

Now, I could close the server all the time without fancying around with <b>unbind</b> but I am afraid that I am only hiding a bigger problem; maybe my RMI approach is not the right one.

My remote object has an instance variable which is the Data class. All clients are expected to get stubs that point to the same instance of the remote object.

I am thinking that the Data class was passed somehow by copy and not by reference to the client.

Testing is done in the same JVM, on the same machine.

Any ideas on why this might happen?

Thank you all in advance,
Adrian



This is the correct behavior for RMI to the best of my knowledge.

When you unbind the remote object it means that new clients cannot obtain a reference to that remote object using the RMI registry. However unbind does not destroy the object it just means that prospective new clients can no longer use the RMI registry to access it.

As the existing client already have a obtained a reference to the remote object they can continue to use it as normal. While all these existing remote client references remain the remote object will continue to exist.

Mark
[ July 11, 2007: Message edited by: Mark Smyth ]
 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mark,

Thanks for taking the time to answer.
It is a relief to know that I haven't misused RMI and the program behaves as expected.

Cheers,
Adrian
 
reply
    Bookmark Topic Watch Topic
  • New Topic