Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > RMI Callback and Threading

Thread Tools

RMI Callback and Threading

H. M?ller
Posts: n/a

i build a thread pool that computes some kind of jobs. The jobs are
delivered by a RMI call (one call with jobarray) to the server
together with a reference to the client (RMI Callback). Each job was
computed by an own thread. A pool thread gets its jobs from a queue,
compute it and invokes a method on the client reference.

Sometimes i get a Connection refused Exception when i do the callback,
but other callbacks work well. So, i enclose the callback with a
synchronization block:

class PoolThread extends Thread {

public PoolThread(IClient client) {
this.client = client;

run() {
synchronized (client) {

Now it works, but i do not understand why. Can anybody give me a hint?
Is it because of several threads doing the callback concurrently? Does
the RMI framework not handle this case?

Again, everything worked well without the invokation of a callback
INSIDE a thead.

Mr. Müller
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
RMI and Threading KDawg44 Java 2 10-13-2007 04:52 PM
Why does java.rmi.Naming not implement interface java.rmi.Registry? Jan Schulze Java 1 03-26-2005 07:45 AM
RMI Vs RMI over IIOP JScoobyCed Java 1 01-28-2005 09:54 AM
RMI, JINI or RMI/IIOP Buu Nguyen Java 1 08-25-2004 11:28 AM
RMI callback and firewalls Alex Molochnikov Java 1 08-04-2003 08:03 AM