|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.util.SequentialExecutionQueue
public class SequentialExecutionQueue
Executor
that collapses two equal Runnable
s into one,
and makes sure no two equal Runnable
s get executed simultaneously.
That is, if a Runnable
is executing and another one gets submitted,
the 2nd one waits for the completion of the 1st one.
Object.equals(Object)
is used on Runnable
to identify
two equal Runnable
s.
Constructor Summary | |
---|---|
SequentialExecutionQueue(ExecutorService executors)
|
Method Summary | |
---|---|
void |
execute(Runnable item)
|
ExecutorService |
getExecutors()
Gets the base underlying executors., |
Set<Runnable> |
getInProgress()
Gets Runnable s that are currently executed by a live thread. |
boolean |
isStarving(long threshold)
Returns true if too much time is spent since some Runnable is submitted into the queue
until they get executed. |
void |
setExecutors(ExecutorService svc)
Starts using a new ExecutorService to carry out executions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SequentialExecutionQueue(ExecutorService executors)
Method Detail |
---|
public ExecutorService getExecutors()
public void setExecutors(ExecutorService svc)
ExecutorService
to carry out executions.
The older ExecutorService
will be shut down (but it's still expected to
complete whatever they are doing and scheduled.)
public void execute(Runnable item)
execute
in interface Executor
public boolean isStarving(long threshold)
Runnable
is submitted into the queue
until they get executed.
public Set<Runnable> getInProgress()
Runnable
s that are currently executed by a live thread.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |