public class TaskRegistry<C extends ApplicationContext> extends AbstractApplicationObject<C> implements TaskRegistrationEvent.Source
AsyncTasks in order to be able to
access them by TaskId and cancel them at any time. It provides a means for detecting TaskRegistrationEvents
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
TaskIds that are registered for cancellation. |
java.util.List<TaskId> |
findAllNonCancellableTaskIds()
Returns a List of all
TaskIds 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, setLogChannelconfigureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toStringpublic 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()
TaskIds that are registered for cancellation.public java.util.List<TaskId> findAllNonCancellableTaskIds()
TaskIds 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.SourceaddTaskRegistrationListener in interface TaskRegistrationEvent.Sourcepublic void removeTaskRegistrationListener(TaskRegistrationEvent.Listener l)
TaskRegistrationEvent.SourceremoveTaskRegistrationListener in interface TaskRegistrationEvent.SourceCopyright © 2014 EsprIT-Systems. All Rights Reserved.