public class DefaultLongRunningTaskManager extends Object implements LongRunningTaskManagerInternal, org.springframework.beans.factory.DisposableBean
| Constructor and Description |
|---|
DefaultLongRunningTaskManager(PermissionManager permissionManager)
|
DefaultLongRunningTaskManager(PermissionManager permissionManager,
ActivityMonitor activityMonitor) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
PageResponse<LongTaskStatus> |
getAllTasks(ConfluenceUser asUser,
LimitedRequest request)
Get all currently-tracked tasks that the specified user can see.
|
com.atlassian.core.task.longrunning.LongRunningTask |
getLongRunningTask(com.atlassian.user.User user,
LongRunningTaskId taskId)
gets a long running task with the given Id that was registered either by this user
or the anonymous user.
|
LongRunningTaskId |
queueLongRunningTask(com.atlassian.core.task.longrunning.LongRunningTask task)
Start tracking a long running task that should be started in a new thread when
LongRunningTaskManagerInternal.startIfQueued(com.atlassian.confluence.util.longrunning.LongRunningTaskId)
is called. |
List<LongTaskStatus> |
removeComplete()
Remove completed tasks from the tracker.
|
void |
resume()
Resume accepting long-running tasks after
LongRunningTaskManager.stop(long, java.util.concurrent.TimeUnit) has been called. |
void |
startIfQueued(LongRunningTaskId taskId)
Starts the task in a new thread if it has previously been queued.
|
LongRunningTaskId |
startLongRunningTask(com.atlassian.user.User user,
com.atlassian.core.task.longrunning.LongRunningTask task)
Start some task in a new thread
|
void |
stop(long timeout,
TimeUnit unit)
Stop accepting new long running tasks.
|
void |
stopTrackingLongRunningTask(LongRunningTaskId taskId)
Clean up an old task.
|
protected void |
taskFinished(LongRunningTaskId taskId) |
@Deprecated public DefaultLongRunningTaskManager(PermissionManager permissionManager)
public DefaultLongRunningTaskManager(PermissionManager permissionManager, ActivityMonitor activityMonitor)
public LongRunningTaskId queueLongRunningTask(com.atlassian.core.task.longrunning.LongRunningTask task)
LongRunningTaskManagerInternalLongRunningTaskManagerInternal.startIfQueued(com.atlassian.confluence.util.longrunning.LongRunningTaskId)
is called.queueLongRunningTask in interface LongRunningTaskManagerInternaltask - the task to performpublic void startIfQueued(LongRunningTaskId taskId)
LongRunningTaskManagerInternalstartIfQueued in interface LongRunningTaskManagerInternaltaskId - the ID of the taskpublic LongRunningTaskId startLongRunningTask(com.atlassian.user.User user, com.atlassian.core.task.longrunning.LongRunningTask task)
LongRunningTaskManagerstartLongRunningTask in interface LongRunningTaskManageruser - the user responsible for the tasktask - the task to performpublic com.atlassian.core.task.longrunning.LongRunningTask getLongRunningTask(com.atlassian.user.User user,
LongRunningTaskId taskId)
getLongRunningTask in interface LongRunningTaskManageruser - the user responsible for the tasktaskId - the ID of the taskpublic PageResponse<LongTaskStatus> getAllTasks(ConfluenceUser asUser, LimitedRequest request)
LongRunningTaskManagerInternalgetAllTasks in interface LongRunningTaskManagerInternalpublic List<LongTaskStatus> removeComplete()
LongRunningTaskManagerInternalremoveComplete in interface LongRunningTaskManagerInternalpublic void stopTrackingLongRunningTask(LongRunningTaskId taskId)
LongRunningTaskManager
This method does not stop a task from being executed. If the task is already running it will continue to completion, you just won't be able to query its status any more.
stopTrackingLongRunningTask in interface LongRunningTaskManagertaskId - the ID of the task to remove.public void destroy()
throws Exception
destroy in interface org.springframework.beans.factory.DisposableBeanExceptionpublic void stop(long timeout,
TimeUnit unit)
throws TimeoutException
LongRunningTaskManagerstop in interface LongRunningTaskManagertimeout - the time to wait for running tasks to completeunit - the unit of measurement for the timeout parameterTimeoutException - if the timeout is exceededpublic void resume()
LongRunningTaskManagerLongRunningTaskManager.stop(long, java.util.concurrent.TimeUnit) has been called. If
the long-running task manager is not stopped, this method will whistle
quietly to itself and do nothing.resume in interface LongRunningTaskManagerprotected void taskFinished(LongRunningTaskId taskId)
Copyright © 2003–2018 Atlassian. All rights reserved.