public class FiberExecutorScheduler extends FiberScheduler implements java.util.concurrent.Executor
Executor for scheduling.
The Runnable tasks passed to the Executor for execution,
implement the FiberSchedulerTask interface.| Constructor and Description |
|---|
FiberExecutorScheduler(java.lang.String name,
java.util.concurrent.Executor executor)
Creates a new fiber scheduler with no monitor.
|
FiberExecutorScheduler(java.lang.String name,
java.util.concurrent.Executor executor,
MonitorType monitorType,
boolean detailedInfo)
Creates a new fiber scheduler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(java.lang.Runnable command) |
java.util.concurrent.Executor |
getExecutor() |
protected int |
getQueueLength() |
protected java.util.Map<java.lang.Thread,Fiber> |
getRunningFibers() |
protected boolean |
isCurrentThreadInScheduler() |
void |
shutdown() |
getMonitor, getName, newFiber, newStrandpublic FiberExecutorScheduler(java.lang.String name,
java.util.concurrent.Executor executor,
MonitorType monitorType,
boolean detailedInfo)
name - the scheuler's name. This name is used in naming the scheduler's threads.executor - an Executor used to schedule the fibers;
may be null if the execute(Runnable) method is overriden.monitorType - the MonitorType type to use for the scheduler.detailedInfo - whether detailed information about the fibers is collected by the fibers monitor.public FiberExecutorScheduler(java.lang.String name,
java.util.concurrent.Executor executor)
name - the scheuler's name. This name is used in naming the scheduler's threads.executor - an Executor used to schedule the fibers;
may be null if the execute(Runnable) method is overriden.public void shutdown()
shutdown in class FiberSchedulerprotected boolean isCurrentThreadInScheduler()
isCurrentThreadInScheduler in class FiberSchedulerprotected int getQueueLength()
getQueueLength in class FiberSchedulerpublic void execute(java.lang.Runnable command)
execute in interface java.util.concurrent.Executorprotected java.util.Map<java.lang.Thread,Fiber> getRunningFibers()
public java.util.concurrent.Executor getExecutor()
getExecutor in class FiberScheduler