class WaitingThread
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.Exception |
exception
A reference to an exception which indicates a failure.
|
private Message |
message
A reference to the reply message.
|
Constructor and Description |
---|
WaitingThread()
Constructs an empty instance.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
notifyException(java.lang.Exception exception)
Notify waiting thread that a failure occurred.
|
(package private) void |
notifyMessage(Message message)
Notify waiting thread that the reply message that matched the request
message's ID has arrived.
|
(package private) Message |
waitMessage(int timeout)
Suspend calling thread and wait until a matching reply message is
received, an exception is thrown, an interruption occurs or there is
a timeout.
|
private java.lang.Exception exception
private Message message
void notifyException(java.lang.Exception exception)
exception
- An exception to deliver. If it is null
then
thread is awakened but an exception will not be thrown.void notifyMessage(Message message)
message
- The reply message that was received.Message waitMessage(int timeout) throws java.lang.InterruptedException, java.lang.Exception
timeout
- Time to wait for reply message (milliseconds).null
if no reply is
received.java.lang.InterruptedException
- Forwarded from Object.wait()
.java.lang.Exception
- Any other failure.