Thread Blocking and Wakeup

I have a networked App where the server is controlling the stages of the application. It sends a request to the client (one of) and waits for a response.

The response will come in from the client at some point in the future in a seperate thread, and if I use wait and notify, I get java.lang.IllegalMonitorStateException: current thread not owner.

Is there a way to wake up the controller following an event when the event notification comes in from a thread other than the controller's thread?

Any help would be much appreciated. I may be forced to resort to polling a data area every few 100 milliseconds, which is quite nasty.

Cheers

Wayne

[681 byte] By [codemwncia] at [2007-10-2 21:47:40]
# 1
If you read the Javadoc for wait() and notify() it should tell you why you are getting this error.However I suggest you use one of the connect collections such as BlockingQueue which may do what you need.
Peter__Lawreya at 2007-7-14 1:03:21 > top of Java-index,Core,Core APIs...
# 2
Errata: Read "connect" as concurrent.
Peter__Lawreya at 2007-7-14 1:03:21 > top of Java-index,Core,Core APIs...