Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java RMI, Threads, waiting for events

843793Nov 13 2003 — edited Jun 21 2004
Hi,

I'm trying to get what strikes me as a fairly simple idea to go, and I don't see how I'd be able to get it to work. I've been rifling through the profuse amounts of documentation online, but I've not found anything yet that really helps me out.

I have an RMI application; a given remotely invocable object requires that data be input from 4 different sources, preferably by calling the same method (the data types are the same, as are the return types, the data just gets amalgamated at the destination).

What I need though, is that all the data is recieved before processing it. The return data is dependant on all the information being present, so therefore I need some way of getting the incoming calls to wait until the data is present and has been processed.

This strikes me as a thread issue. I'd need some way of getting a thread of execution to somehow delay inside this method, so that the return data can be recieved then calculated.

Ok, I could let the incoming call drop out with a void return type and call back to the sender later with the required data, but that involves twice as many RMI calls, and would create far messier code (believe me :) )

Does anyone have any magical insights into how I'd get around this problem? I've been reading on threads. Neither sleep nor wait appears to do what I'd like.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2004
Added on Nov 13 2003
6 comments
433 views