|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovyx.gpars.serial.WithSerialId groovyx.gpars.actor.impl.MessageStream groovyx.gpars.actor.impl.MessageStream.ResultWaiter
private static class MessageStream.ResultWaiter extends MessageStream
Represents a pending request for a reply from an actor.
- The type of expected reply messageField Summary | |
---|---|
private boolean |
isSet
|
private static long |
serialVersionUID
|
private java.lang.Object |
value
Holds a reference to the calling thread, while waiting, and the received reply message, once it has arrived. |
Fields inherited from class MessageStream | |
---|---|
serialVersionUID |
Fields inherited from class WithSerialId | |
---|---|
serialHandle, serialVersionUID |
Constructor Summary | |
private MessageStream.ResultWaiter()
|
Method Summary | |
---|---|
V
|
getResult()
Retrieves the response blocking until a message arrives |
java.lang.Object
|
getResult(long timeout, java.util.concurrent.TimeUnit units)
Retrieves the response blocking until a message arrives |
void
|
onDeliveryError(java.lang.Object msg)
Handle cases when the message sent to the actor doesn't get delivered |
private void
|
rethrowException()
|
MessageStream
|
send(java.lang.Object message)
Accepts the message as a reply and wakes up the sleeping thread. |
Methods inherited from class MessageStream | |
---|---|
call, getRemoteClass, leftShift, reInterrupt, send, send, send, sendAndWait, sendAndWait, sendAndWait |
Methods inherited from class WithSerialId | |
---|---|
createRemoteHandle, getOrCreateSerialHandle, getRemoteClass, writeReplace |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
private boolean isSet
private static final long serialVersionUID
private java.lang.Object value
Constructor Detail |
---|
private MessageStream.ResultWaiter()
Method Detail |
---|
@SuppressWarnings("unchecked") public V getResult()
public java.lang.Object getResult(long timeout, java.util.concurrent.TimeUnit units)
timeout
- How long to waitunits
- Unit for the timeout
@SuppressWarnings("unused") // TODO: Eclipse requires this to be tagged as unused. public void onDeliveryError(java.lang.Object msg)
msg
- The message that failed to get delivered
private void rethrowException()
@Override public MessageStream send(java.lang.Object message)
message
- message to send
Copyright © 2008–2010 Václav Pech. All Rights Reserved.