public class Actor<SELF extends Actor> extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
Queue |
__cbQueue |
ConcurrentLinkedQueue<RemoteConnection> |
__connections |
Thread |
__currentDispatcher |
Queue |
__mailbox |
int |
__mbCapacity |
long |
__nanos |
int |
__remoteId |
Scheduler |
__scheduler |
Actor |
__self |
boolean |
__stopped |
static String |
CONT
use value as error to indicate more messages are to come (else remoting will close channel).
|
static String |
FIN
use this value to signal no more messages.
|
static String |
FINSILENT
use value to signal no more messages.
|
static ThreadLocal<Actor> |
sender |
| Constructor and Description |
|---|
Actor()
required by bytecode magic.
|
| Modifier and Type | Method and Description |
|---|---|
void |
__addRemoteConnection(RemoteConnection con) |
void |
__addStopHandler(Callback<SELF> cb) |
Object |
__enqueueCall(Actor receiver,
String methodName,
Object[] args) |
Method |
__getCachedMethod(String methodName,
Actor actor) |
void |
__removeRemoteConnection(RemoteConnection con) |
void |
__stop() |
void |
$close()
closes associated remote connection(s) if present.
|
void |
$stop()
$$stop receiving events.
|
Future |
$sync()
can be used to wait for all messages having been processed
|
protected <T> Future<T> |
async(Callable<T> callable)
execute a callable asynchronously (in a different thread) and return a future
of the result (delivered in caller thread)
|
protected void |
checkThread()
Debug method.
|
static boolean |
Cont(Object o) |
protected void |
delayed(long millis,
Runnable toRun)
schedule an action or call delayed.
|
static boolean |
Fin(Object o) |
SELF |
getActor() |
Actor |
getActorRef() |
int |
getCallbackSize() |
ActorProxyFactory |
getFactory() |
int |
getMailboxSize() |
Scheduler |
getScheduler() |
protected <T> T |
inThread(Actor proxy,
T cbInterface) |
boolean |
isCallbackQPressured() |
boolean |
isMailboxPressured() |
boolean |
isProxy() |
boolean |
isRemote() |
boolean |
isStopped() |
protected SELF |
self()
use this to call public methods using actor-dispatch instead of direct in-thread call.
|
void |
stopSafeClose()
avoids exception when closing an actor after stop has been called.
|
protected Future<Future[]> |
yield(Future... futures) |
protected <T> Future<List<Future<T>>> |
yieldList(List<Future<T>> futures) |
public static final String FINSILENT
public static final String CONT
public static final String FIN
public static ThreadLocal<Actor> sender
public Queue __mailbox
public int __mbCapacity
public Queue __cbQueue
public Thread __currentDispatcher
public Scheduler __scheduler
public volatile boolean __stopped
public long __nanos
public Actor __self
public int __remoteId
public volatile ConcurrentLinkedQueue<RemoteConnection> __connections
public Actor()
public static boolean Fin(Object o)
public static boolean Cont(Object o)
protected SELF self()
public ActorProxyFactory getFactory()
public SELF getActor()
public void $stop()
public boolean isStopped()
public boolean isProxy()
protected <T> Future<T> async(Callable<T> callable)
T - callable - protected <T> T inThread(Actor proxy, T cbInterface)
protected void delayed(long millis,
Runnable toRun)
public Scheduler getScheduler()
public boolean isMailboxPressured()
public boolean isCallbackQPressured()
public int getMailboxSize()
public int getCallbackSize()
protected final void checkThread()
public Actor getActorRef()
public boolean isRemote()
public void $close()
public void stopSafeClose()
public Future $sync()
public void __addRemoteConnection(RemoteConnection con)
public void __removeRemoteConnection(RemoteConnection con)
public void __stop()
Copyright © 2014. All rights reserved.