|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovyx.gpars.actor.impl.ReceivingMessageStream
gpars.actor.Actor
public abstract class Actor extends ReceivingMessageStream
Actors are active objects, which borrow a thread from a thread pool. The Actor interface provides means to send messages to the actor, start and stop the background thread as well as check its status.
Nested Class Summary | |
---|---|
static class |
Actor.MyRemoteHandle
|
static class |
Actor.RemoteActor
|
Constructor Summary | |
protected Actor()
|
|
protected Actor(DataFlowExpression joinLatch)
Constructor to be used by deserialization |
Method Summary | |
---|---|
protected RemoteHandle
|
createRemoteHandle(SerialHandle handle, SerialContext host)
|
protected static void
|
deregisterCurrentActorWithThread()
Deregisters the actor registered from the thread |
DataFlowExpression
|
getJoinLatch()
Join-point for this actor |
boolean
|
isActive()
Checks the current status of the Actor. |
boolean
|
isActorThread()
Checks whether the current thread is the actor's worker thread. |
void
|
join()
Joins the actor. |
void
|
join(MessageStream listener)
Notify listener when finished |
void
|
join(long timeout, TimeUnit unit)
Joins the actor. |
void
|
join(groovy.time.BaseDuration duration)
Joins the actor. |
protected static void
|
registerCurrentActorWithThread(Actor currentActor)
Registers the actor with the current thread |
Actor
|
start()
Starts the Actor. |
Actor
|
stop()
Send message to stop to the Actor. |
Actor
|
terminate()
Terminates the Actor. |
static Actor
|
threadBoundActor()
Retrieves the actor registered with the current thread |
Constructor Detail |
---|
protected Actor()
protected Actor(DataFlowExpression joinLatch)
joinLatch
- The instance of DataFlowExpression to use for join operation
Method Detail |
---|
@Override protected RemoteHandle createRemoteHandle(SerialHandle handle, SerialContext host)
protected static void deregisterCurrentActorWithThread()
public DataFlowExpression getJoinLatch()
public boolean isActive()
public boolean isActorThread()
public final void join()
public final void join(MessageStream listener)
listener
- listener to notify
public final void join(long timeout, TimeUnit unit)
timeout
- timeoutunit
- units of timeout
public final void join(groovy.time.BaseDuration duration)
duration
- timeout to wait
protected static void registerCurrentActorWithThread(Actor currentActor)
currentActor
- The actor to register
public Actor start()
public Actor stop()
public Actor terminate()
public static Actor threadBoundActor()
Groovy Documentation