public class TaskRegistry<C extends ApplicationContext> extends AbstractApplicationObject<C> implements TaskRegistrationEvent.Source
AsyncTask
s in order to be able to
access them by TaskId
and cancel them at any time. It provides a means for detecting TaskRegistrationEvent
s
in order to reflect the running tasks in GUI ListModels.Constructor and Description |
---|
TaskRegistry(C ctx) |
Modifier and Type | Method and Description |
---|---|
void |
addTaskRegistrationListener(TaskRegistrationEvent.Listener l)
Register as a listener for this event type.
|
boolean |
cancelTask(TaskId taskId)
Cancels the running task by
TaskId . |
void |
deregisterTask(AsyncTask task)
De-registers the given task from the
TaskManager . |
protected java.util.List<TaskId> |
findAllCancellableTaskIds()
Returns a List of all
TaskId s that are registered for cancellation. |
java.util.List<TaskId> |
findAllNonCancellableTaskIds()
Returns a List of all
TaskId s that are registered but uncancellable. |
AsyncTask |
findTask(TaskId taskId) |
AsyncTask |
findTaskByName(java.lang.String taskName) |
int |
getTaskCount() |
void |
registerTask(AsyncTask task)
Registers the given task within the
TaskManager . |
void |
registerTaskStateChange(RunStateFlag stateFlag)
This call causes a
TaskRegistrationEvent of type ChangeType.UPDATE to be fired. |
void |
removeTaskRegistrationListener(TaskRegistrationEvent.Listener l)
Deregister the listener.
|
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString
public TaskRegistry(C ctx)
public boolean cancelTask(TaskId taskId)
TaskId
.public final AsyncTask findTaskByName(java.lang.String taskName)
public int getTaskCount()
protected java.util.List<TaskId> findAllCancellableTaskIds()
TaskId
s that are registered for cancellation.public java.util.List<TaskId> findAllNonCancellableTaskIds()
TaskId
s that are registered but uncancellable.public void registerTask(AsyncTask task)
TaskManager
.
This call causes a TaskRegistrationEvent
of type ChangeType.CREATE
to be fired.public void deregisterTask(AsyncTask task)
TaskManager
.
This call causes a TaskRegistrationEvent
of type ChangeType.DELETE
to be fired.public void registerTaskStateChange(RunStateFlag stateFlag)
TaskRegistrationEvent
of type ChangeType.UPDATE
to be fired.public void addTaskRegistrationListener(TaskRegistrationEvent.Listener l)
TaskRegistrationEvent.Source
addTaskRegistrationListener
in interface TaskRegistrationEvent.Source
public void removeTaskRegistrationListener(TaskRegistrationEvent.Listener l)
TaskRegistrationEvent.Source
removeTaskRegistrationListener
in interface TaskRegistrationEvent.Source
Copyright © 2014 EsprIT-Systems. All Rights Reserved.