Package org.jbrew.concurrent
Interface TaskRegistry
- All Known Implementing Classes:
TaskRegister
public interface TaskRegistry
A
TaskRegistry
is an interface specifying the requirements for a "register" or collection of
Tasks.- Author:
- nealk
- See Also:
TaskRegister
-
Method Summary
Modifier and Type Method Description int
getRegistrySize()
void
interruptAll()
void
offer(Task<?> task)
Inserts the specified element into thisTaskRegistry
.void
offer(Task<?>... tasks)
Inserts the specified element into thisTaskRegistry
.Task<?>
pollTask()
boolean
remove(Task<?> task)
Removes a single instance of the specifiedTask
from thisTaskRegistry
, if it is present.
-
Method Details
-
offer
Inserts the specified element into thisTaskRegistry
. On average, the performance runtime of this method is O(1).- Parameters:
task
- - TheTask
to be inserted.- See Also:
TaskRegister.offer(Task)
-
offer
Inserts the specified element into thisTaskRegistry
. This is thevarargs
implementation ofoffer(Task)
, meaning that it handles all instances where there are either 0 or >1 parameter arguments present.- Parameters:
tasks
- - The set of zero or moreTask
to be inserted into this registry.
-
remove
Removes a single instance of the specifiedTask
from thisTaskRegistry
, if it is present. More formally, removes aTask task
such thattask
is no longer present in theTaskRegistry
if thisTaskRegistry
contains one or more such elements.- Parameters:
task
- - TheTask
to be removed.- Returns:
-
getRegistrySize
int getRegistrySize() -
pollTask
Task<?> pollTask() -
interruptAll
void interruptAll()
-