Question regarding RMI

J

Johs32

I have a remote object "Server" that sends the text "hi there" every 5
seconds. If I unbind it it keeps going on with the text.

Only if I make it return myself after a lookup in the rmiregistry (which
throws an exception if its not there) I can terminate it.

How does remote objects normally crash - do they throw some exception?

Seems wierd that they keep executing eventhough I have them unbinded, and
first stop if I explicitly make a lookup check.

I run the code on my own computer where I have started rmiregistry in winXP.
 
M

Matt Humphrey

Johs32 said:
I have a remote object "Server" that sends the text "hi there" every 5
seconds. If I unbind it it keeps going on with the text.


I'm somewhat baffled by your opening statement here. There's nothing in an
RMI server that automatically gives it repeating behavior and in any case
where would it send the message as you havn't mentioned clients. At first I
figured that you're talking about RMI callbacks. However, you might mean
that the server process prints text every 5 seconds. In either case, it
seems the culprit is the thread you make to do this 5-second printing. That
process will not be affected by you unbinding the server. The server
binding affects its ability to accept requests, but doesn't affect
connections already in place. The callback object is essentially a
different server with a different connection--it will keep going until you
stop your thread. If it's just the text, you must stop that thread
yourself.
Only if I make it return myself after a lookup in the rmiregistry (which
throws an exception if its not there) I can terminate it.

It sounds like your registration thread is really a loop, which explains the
repeating behavior.
How does remote objects normally crash - do they throw some exception?

A normal RMI server responds to requests, any of which might individually
fail, but that normally doesn't affect the operation of the listening
process. The server is considered crashed when it stops accepting
connections. If your server has an internal process--its operation is
separate from how it accepts requests.
Seems wierd that they keep executing eventhough I have them unbinded, and
first stop if I explicitly make a lookup check.

I run the code on my own computer where I have started rmiregistry in
winXP.

Can you describe in more detail what your server really does or post a
simplified (very simplified) version of your server that exhibits this
behavior?

Matt Humphrey (e-mail address removed) http://www.iviz.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

RMI & connection refused 10
Java RMI - registry questions 3
RMI questions 1
Java RMI questions and MyEclipse 8
RMI connection refused 14
RMI question 0
simple RMI chat problem 1
RMI question 7

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,785
Latest member
undedgini

Latest Threads

Top