|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.evolveum.midpoint.task.impl.TaskManagerImpl
@Service(value="taskManager") @DependsOn(value="repositoryService") public class TaskManagerImpl
Task Manager implementation. VERY SIMPLISTIC. This needs to be updated later. It assumes only a single host. No cluster, in fact not even a repository access. So the tasks will not survive restarts.
| Constructor Summary | |
|---|---|
TaskManagerImpl()
|
|
| Method Summary | |
|---|---|
java.lang.String |
addTask(TaskType taskType,
OperationResult parentResult)
Add new task. |
void |
claimTask(Task task,
OperationResult parentResult)
Claim task exclusively for this node. |
Task |
createTaskInstance()
Creates new transient, running, claimed task instance. |
Task |
createTaskInstance(java.lang.String operationName)
Creates new transient, running, claimed task instance. |
Task |
createTaskInstance(TaskType taskType,
OperationResult parentResult)
Creates task instance from the XML task representation. |
Task |
createTaskInstance(TaskType taskType,
java.lang.String operationName,
OperationResult parentResult)
Creates task instance from the XML task representation. |
void |
deactivateServiceThreads()
Deactivate service threads (temporarily). |
void |
deleteTask(java.lang.String oid,
OperationResult parentResult)
Deletes task with provided OID. |
long |
determineNextRunStartTime(TaskType taskType)
Helper function, used to determine when this task should run next (0 if it is not a recurring task). |
java.util.Set<Task> |
getRunningTasks()
Returns tasks that currently run on this node. |
boolean |
getServiceThreadsActivationState()
Returns true if the service threads are running. |
Task |
getTask(java.lang.String taskOid,
OperationResult parentResult)
Returns a task with specified OID. |
void |
init()
|
boolean |
isTaskThreadActive(java.lang.String taskIdentifier)
Indicates whether execution thread for this task is active (i.e. |
java.util.Set<Task> |
listTasks()
Lists all tasks. |
void |
modifyTask(ObjectModificationType objectChange,
OperationResult parentResult)
Modifies task using relative change description. |
void |
processRunnableTask(Task task)
|
void |
processRunnableTaskType(TaskType taskType,
OperationResult parentResult)
Process runnable task with TaskType XML object as an argument. |
void |
reactivateServiceThreads()
Re-activate the service threads after they have been deactivated. |
void |
recordNextRunStartTime(java.lang.String oid,
long time,
OperationResult result)
|
void |
registerHandler(java.lang.String uri,
TaskHandler handler)
Register a handler for a specified handler URI. |
void |
releaseTask(Task task,
OperationResult parentResult)
Release a claimed task. |
void |
resumeTask(Task task,
OperationResult result)
Resume suspended task. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
|
void |
shutdown()
Make sure all processes are stopped properly. |
boolean |
suspendTask(Task task,
long waitTime,
OperationResult parentResult)
Draft implementation. |
void |
switchToBackground(Task task,
OperationResult parentResult)
Switches the provided task to background, making it asynchronous. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TaskManagerImpl()
| Method Detail |
|---|
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansException@PostConstruct public void init()
@PreDestroy public void shutdown()
TaskManager
shutdown in interface TaskManagerpublic Task createTaskInstance()
TaskManager
createTaskInstance in interface TaskManagerpublic Task createTaskInstance(java.lang.String operationName)
TaskManager
createTaskInstance in interface TaskManageroperationName - operation name to use as a root for new result in task
public Task createTaskInstance(TaskType taskType,
OperationResult parentResult)
throws SchemaException
TaskManager
createTaskInstance in interface TaskManagertaskType - JAXB (XML) representation of the task
SchemaException - The provided taskType is not compliant to schema
public Task createTaskInstance(TaskType taskType,
java.lang.String operationName,
OperationResult parentResult)
throws SchemaException
TaskManager
createTaskInstance in interface TaskManagertaskType - JAXB (XML) representation of the taskoperationName - operation name to use as a root for new result in task
SchemaException - The provided taskType is not compliant to schema
public Task getTask(java.lang.String taskOid,
OperationResult parentResult)
throws ObjectNotFoundException,
SchemaException
TaskManager
getTask in interface TaskManagertaskOid - OID of the persistent task.
ObjectNotFoundException - wrong OID format, etc.
SchemaException - error dealing with resource schema
public void claimTask(Task task,
OperationResult parentResult)
throws ObjectNotFoundException,
ConcurrencyException,
SchemaException
TaskManager
claimTask in interface TaskManagertask - task instance to claim
ObjectNotFoundException
ConcurrencyException
SchemaException
public void releaseTask(Task task,
OperationResult parentResult)
throws ObjectNotFoundException,
SchemaException
TaskManager
releaseTask in interface TaskManagertask - task instance to release
ObjectNotFoundException
SchemaException
public void switchToBackground(Task task,
OperationResult parentResult)
TaskManager
switchToBackground in interface TaskManagertask - task to switch to background.public java.util.Set<Task> listTasks()
TaskManager
listTasks in interface TaskManager
public void registerHandler(java.lang.String uri,
TaskHandler handler)
TaskManager
registerHandler in interface TaskManager
public void processRunnableTaskType(TaskType taskType,
OperationResult parentResult)
throws SchemaException
task - XML TaskType object
SchemaExceptionpublic void processRunnableTask(Task task)
public java.util.Set<Task> getRunningTasks()
TaskManager
getRunningTasks in interface TaskManager
public java.lang.String addTask(TaskType taskType,
OperationResult parentResult)
throws ObjectAlreadyExistsException,
SchemaException
TaskManager
addTask in interface TaskManagerparentResult - parent OperationResult (in/out)
ObjectAlreadyExistsException - object with specified identifiers already exists, cannot add
SchemaException - error dealing with storage schema, e.g. schema violation
public void modifyTask(ObjectModificationType objectChange,
OperationResult parentResult)
throws ObjectNotFoundException,
SchemaException
TaskManager
modifyTask in interface TaskManagerobjectChange - specification of object changesparentResult - parent OperationResult (in/out)
ObjectNotFoundException - specified object does not exist
SchemaException - resulting object would violate the schema
public void deleteTask(java.lang.String oid,
OperationResult parentResult)
throws ObjectNotFoundException
TaskManager
deleteTask in interface TaskManageroid - OID of object to deleteparentResult - parent OperationResult (in/out)
ObjectNotFoundException - specified object does not existpublic void deactivateServiceThreads()
TaskManager
deactivateServiceThreads in interface TaskManagerpublic void reactivateServiceThreads()
TaskManager
reactivateServiceThreads in interface TaskManagerpublic boolean getServiceThreadsActivationState()
TaskManager
getServiceThreadsActivationState in interface TaskManagerpublic long determineNextRunStartTime(TaskType taskType)
TaskManager
determineNextRunStartTime in interface TaskManager
public boolean suspendTask(Task task,
long waitTime,
OperationResult parentResult)
throws ObjectNotFoundException,
SchemaException
suspendTask in interface TaskManagertask - task instance to claim
ObjectNotFoundException
SchemaException
public void resumeTask(Task task,
OperationResult result)
throws ObjectNotFoundException,
ConcurrencyException,
SchemaException
TaskManager
resumeTask in interface TaskManagertask - task instance to claim
ObjectNotFoundException
ConcurrencyException
SchemaException
public void recordNextRunStartTime(java.lang.String oid,
long time,
OperationResult result)
throws ObjectNotFoundException,
SchemaException
ObjectNotFoundException
SchemaExceptionpublic boolean isTaskThreadActive(java.lang.String taskIdentifier)
TaskManager
isTaskThreadActive in interface TaskManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||