public class SimpleScheduler extends Object implements Scheduler
| Modifier and Type | Field and Description |
|---|---|
protected BackOffStrategy |
backOffStrategy |
static long |
BLOCKED_MS_TIL_WARN
time ms until a warning is printed once a sender is blocked by a
full actor queue
|
static boolean |
DEBUG_SCHEDULING |
static int |
DEFQSIZE |
protected DispatcherThread |
myThread |
| Modifier | Constructor and Description |
|---|---|
|
SimpleScheduler() |
|
SimpleScheduler(boolean keepAlive) |
|
SimpleScheduler(int qsize) |
|
SimpleScheduler(int qsize,
boolean keepAlive) |
|
SimpleScheduler(int qsize,
boolean keepAlive,
String name) |
protected |
SimpleScheduler(String dummy) |
| Modifier and Type | Method and Description |
|---|---|
DispatcherThread |
assignDispatcher(int minLoadPerc) |
protected CallEntry |
createCallentry(RemoteRegistry reg,
Object[] args,
boolean isCB,
Actor actor,
Method method) |
void |
delayedCall(long millis,
Runnable toRun) |
Object |
enqueueCall(Actor sendingActor,
Actor receiver,
String methodName,
Object[] args,
boolean isCB) |
Object |
enqueueCall(RemoteRegistry reg,
Actor sendingActor,
Actor receiver,
String methodName,
Object[] args,
boolean isCB) |
Object |
enqueueCallFromRemote(RemoteRegistry reg,
Actor sendingActor,
Actor receiver,
String methodName,
Object[] args,
boolean isCB,
Object securityContext,
BiFunction<Actor,String,Boolean> callInterceptor) |
static Class[] |
getAllInterfaces(Class<?> clazz) |
static Set<Class<?>> |
getAllInterfacesForClassAsSet(Class<?> clazz,
ClassLoader classLoader) |
BackOffStrategy |
getBackoffStrategy() |
int |
getDefaultQSize() |
InvocationHandler |
getInvoker(Actor dispatcher,
Object toWrap) |
int |
getNumActors() |
IPromise |
getReport() |
IPromise<Monitorable[]> |
getSubMonitorables() |
<T> T |
inThread(Actor actor,
T callback)
Creates a wrapper on the given object enqueuing all calls to INTERFACE methods of the given object to the given actors's queue.
|
void |
pollDelay(int count) |
IPromise |
put2QueuePolling(CallEntry e) |
void |
put2QueuePolling(Queue q,
boolean isCBQ,
Object o,
Object receiver) |
void |
rebalance(DispatcherThread dispatcherThread)
called from inside overloaded thread with load
all actors assigned to the calling thread therefore can be safely moved
|
<T> void |
runBlockingCall(Actor emitter,
Callable<T> toCall,
Callback<T> resultHandler) |
void |
setKeepAlive(boolean b) |
void |
terminateIfIdle() |
void |
threadStopped(DispatcherThread th) |
void |
tryIsolate(DispatcherThread dp,
Actor actorRef) |
void |
tryStopThread(DispatcherThread dispatcherThread) |
public static final boolean DEBUG_SCHEDULING
public static long BLOCKED_MS_TIL_WARN
public static int DEFQSIZE
protected BackOffStrategy backOffStrategy
protected DispatcherThread myThread
protected SimpleScheduler(String dummy)
public SimpleScheduler()
public SimpleScheduler(boolean keepAlive)
public SimpleScheduler(int qsize)
public SimpleScheduler(int qsize,
boolean keepAlive)
qsize - keepAlive - - keep thread idle even if no actor is scheduled. Required for assisted scheduling e.g.
in serverspublic SimpleScheduler(int qsize,
boolean keepAlive,
String name)
public int getDefaultQSize()
getDefaultQSize in interface Schedulerpublic void put2QueuePolling(Queue q, boolean isCBQ, Object o, Object receiver)
put2QueuePolling in interface Schedulerpublic Object enqueueCall(Actor sendingActor, Actor receiver, String methodName, Object[] args, boolean isCB)
enqueueCall in interface Schedulerpublic Object enqueueCall(RemoteRegistry reg, Actor sendingActor, Actor receiver, String methodName, Object[] args, boolean isCB)
enqueueCall in interface Schedulerpublic Object enqueueCallFromRemote(RemoteRegistry reg, Actor sendingActor, Actor receiver, String methodName, Object[] args, boolean isCB, Object securityContext, BiFunction<Actor,String,Boolean> callInterceptor)
enqueueCallFromRemote in interface Schedulerprotected CallEntry createCallentry(RemoteRegistry reg, Object[] args, boolean isCB, Actor actor, Method method)
public void terminateIfIdle()
terminateIfIdle in interface Schedulerpublic void threadStopped(DispatcherThread th)
threadStopped in interface Schedulerpublic void setKeepAlive(boolean b)
public InvocationHandler getInvoker(Actor dispatcher, Object toWrap)
getInvoker in interface Schedulerpublic static Set<Class<?>> getAllInterfacesForClassAsSet(Class<?> clazz, ClassLoader classLoader)
public <T> T inThread(Actor actor, T callback)
Schedulerpublic void delayedCall(long millis,
Runnable toRun)
delayedCall in interface Schedulerpublic <T> void runBlockingCall(Actor emitter, Callable<T> toCall, Callback<T> resultHandler)
runBlockingCall in interface Schedulerpublic DispatcherThread assignDispatcher(int minLoadPerc)
assignDispatcher in interface Schedulerpublic void rebalance(DispatcherThread dispatcherThread)
Schedulerpublic BackOffStrategy getBackoffStrategy()
getBackoffStrategy in interface Schedulerpublic void tryStopThread(DispatcherThread dispatcherThread)
tryStopThread in interface Schedulerpublic void tryIsolate(DispatcherThread dp, Actor actorRef)
tryIsolate in interface Schedulerpublic int getNumActors()
getNumActors in interface Schedulerpublic IPromise getReport()
getReport in interface Monitorablepublic IPromise<Monitorable[]> getSubMonitorables()
getSubMonitorables in interface MonitorableCopyright © 2017. All rights reserved.