public abstract class MessageStream extends WithSerialId
Modifier and Type | Class and Description |
---|---|
static class |
MessageStream.RemoteMessageStream |
private static class |
MessageStream.ResultWaiter<V>
Represents a pending request for a reply from an actor.
|
static class |
MessageStream.SendTo |
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
serialHandle
Constructor and Description |
---|
MessageStream() |
Modifier and Type | Method and Description |
---|---|
<T> MessageStream |
call(T message)
Same as send
|
java.lang.Class<MessageStream.RemoteMessageStream> |
getRemoteClass()
Class of remote object to be created
|
<T> MessageStream |
leftShift(T message)
Same as send
|
(package private) static void |
reInterrupt() |
MessageStream |
send()
Convenience method for send(new Object()).
|
abstract MessageStream |
send(java.lang.Object message)
Send message to stream and return immediately
|
<T> MessageStream |
send(T message,
MessageStream replyTo)
Send message to stream and return immediately.
|
<T,V> V |
sendAndWait(T message)
Sends a message and waits for a reply.
|
<T> java.lang.Object |
sendAndWait(T message,
groovy.time.Duration duration)
Sends a message and waits for a reply.
|
<T> java.lang.Object |
sendAndWait(T message,
long timeout,
java.util.concurrent.TimeUnit units)
Sends a message and waits for a reply.
|
createRemoteHandle, getOrCreateSerialHandle, writeReplace
private static final long serialVersionUID
public abstract MessageStream send(java.lang.Object message)
message
- message to sendpublic final MessageStream send()
public final <T> MessageStream send(T message, MessageStream replyTo)
T
- type of message accepted by the streammessage
- message to sendreplyTo
- where to send replypublic final <T> MessageStream leftShift(T message)
message
- to sendpublic final <T> MessageStream call(T message)
message
- to sendpublic final <T,V> V sendAndWait(T message) throws java.lang.InterruptedException
message
- message to sendjava.lang.InterruptedException
- if interrupted while waitingpublic final <T> java.lang.Object sendAndWait(T message, long timeout, java.util.concurrent.TimeUnit units) throws java.lang.InterruptedException
message
- message to sendtimeout
- timeoutunits
- unitsjava.lang.InterruptedException
- if interrupted while waitingpublic final <T> java.lang.Object sendAndWait(T message, groovy.time.Duration duration) throws java.lang.InterruptedException
message
- message to sendduration
- timeoutjava.lang.InterruptedException
- if interrupted while waitingpublic java.lang.Class<MessageStream.RemoteMessageStream> getRemoteClass()
WithSerialId
getRemoteClass
in class WithSerialId
static void reInterrupt() throws java.lang.InterruptedException
java.lang.InterruptedException