public abstract class JobExecutor extends Object implements Executor
Partition jobs require some special handling with executors. Extending this in implementations will give the desired
behavior to the implementing class. Note that getMaximumPoolSize()
should return a value greater than 2.
Modifier | Constructor and Description |
---|---|
protected |
JobExecutor(Executor delegate)
Creates a new executor.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(JobTask task)
Executes the given task at some time in the future.
|
void |
execute(Runnable runnable) |
protected abstract int |
getMaximumPoolSize()
Returns the maximum number of threads allowed to be executed.
|
protected JobExecutor(Executor delegate)
delegate
- the executor that tasks should be submitted to when they are able to runprotected abstract int getMaximumPoolSize()
public final void execute(JobTask task)
If the JobTask.getRequiredRemainingPermits()
is any value greater than 0
then the task may be
queued for later execution if the number of permits used is greater than the maximum permits allowed plus the
number of remaining permits required.
As an example if the maximum number of permits allowed is 5 and 4 threads are executing an invocation with 2
JobTask.getRequiredRemainingPermits()
would be queued.
task
- the task to runCopyright © 2016 JBoss by Red Hat. All rights reserved.