org.codehaus.gpars

groovyx.gpars.actor.impl
[Java] Class MessageStream

java.lang.Object
  groovyx.gpars.serial.WithSerialId
      groovyx.gpars.actor.impl.MessageStream

public abstract class MessageStream
extends WithSerialId

Represents a stream of messages and forms the base class for actors

Authors:
Alex Tkachman, Vaclav Pech, Dierk Koenig


Nested Class Summary
static class MessageStream.RemoteMessageStream

private static class MessageStream.ResultWaiter

static class MessageStream.SendTo

 
Field Summary
private static long serialVersionUID

 
Fields inherited from class WithSerialId
serialHandle, serialVersionUID
 
Constructor Summary
MessageStream()

 
Method Summary
MessageStream call(java.lang.Object message)

java.lang.Class getRemoteClass()

MessageStream leftShift(java.lang.Object message)

static void reInterrupt()

MessageStream send(java.lang.Object message)

MessageStream send()

MessageStream send(java.lang.Object message, MessageStream replyTo)

Same as send

java.lang.Object sendAndWait(java.lang.Object message)

java.lang.Object sendAndWait(java.lang.Object message, long timeout, java.util.concurrent.TimeUnit units)

Sends a message and waits for a reply.

java.lang.Object sendAndWait(java.lang.Object message, groovy.time.Duration duration)

 
Methods inherited from class WithSerialId
createRemoteHandle, getOrCreateSerialHandle, getRemoteClass, writeReplace
 

Field Detail

serialVersionUID

private static final long serialVersionUID


 
Constructor Detail

MessageStream

MessageStream()


 
Method Detail

call

public final MessageStream call(java.lang.Object message)


getRemoteClass

@java.lang.Override* @param  The type of expected reply message
@java.lang.SuppressWarnings*/
public java.lang.Class getRemoteClass()


leftShift

public final MessageStream leftShift(java.lang.Object message)


reInterrupt

static void reInterrupt()


send

public MessageStream send(java.lang.Object message)


send

public final MessageStream send()


send

public final MessageStream send(java.lang.Object message, MessageStream replyTo)
Same as send
Parameters:
message - to send
Returns:
original stream


sendAndWait

public final java.lang.Object sendAndWait(java.lang.Object message)


sendAndWait

public final java.lang.Object sendAndWait(java.lang.Object message, long timeout, java.util.concurrent.TimeUnit units)
Sends a message and waits for a reply. Timeouts after the specified timeout. In case of timeout returns null. Returns the reply or throws an IllegalStateException, if the target actor cannot reply.
throws:
InterruptedException if interrupted while waiting
Parameters:
message - message to send
duration - timeout
Returns:
The message that came in reply to the original send.


sendAndWait

public final java.lang.Object sendAndWait(java.lang.Object message, groovy.time.Duration duration)


 

Copyright © 2008–2013 Václav Pech. All Rights Reserved.