Package org.jbrew.concurrent
Class TaskRegister
java.lang.Object
org.jbrew.concurrent.TaskRegister
- All Implemented Interfaces:
TaskRegistry
public class TaskRegister extends java.lang.Object implements TaskRegistry
-
Constructor Summary
Constructors Constructor Description TaskRegister()
-
Method Summary
Modifier and Type Method Description int
getRegistrySize()
void
interruptAll()
void
offerTask(Task<?> task)
Inserts the specified element into thisTaskRegistry
.Task<?>
pollTask()
void
removeTask(Task<?> task)
Removes a single instance of the specifiedTask
from thisTaskRegistry
, if it is present.
-
Constructor Details
-
TaskRegister
public TaskRegister()
-
-
Method Details
-
offerTask
Description copied from interface:TaskRegistry
Inserts the specified element into thisTaskRegistry
. Note that theTaskRegistry
is unbounded.- Specified by:
offerTask
in interfaceTaskRegistry
- Parameters:
task
- - TheTask
to be inserted.
-
removeTask
Description copied from interface:TaskRegistry
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.- Specified by:
removeTask
in interfaceTaskRegistry
- Parameters:
task
- - TheTask
to be removed.
-
pollTask
- Specified by:
pollTask
in interfaceTaskRegistry
-
interruptAll
public void interruptAll()- Specified by:
interruptAll
in interfaceTaskRegistry
-
getRegistrySize
public int getRegistrySize()- Specified by:
getRegistrySize
in interfaceTaskRegistry
-