|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.util.longrunning.DefaultLongRunningTaskManager
public class DefaultLongRunningTaskManager
Constructor Summary | |
---|---|
DefaultLongRunningTaskManager(PermissionManager permissionManager)
Deprecated. since 5.7 use DefaultLongRunningTaskManager(com.atlassian.confluence.security.PermissionManager, com.atlassian.confluence.util.profiling.ActivityMonitor) |
|
DefaultLongRunningTaskManager(PermissionManager permissionManager,
ActivityMonitor activityMonitor)
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Deprecated public DefaultLongRunningTaskManager(PermissionManager permissionManager)
DefaultLongRunningTaskManager(com.atlassian.confluence.security.PermissionManager, com.atlassian.confluence.util.profiling.ActivityMonitor)
public DefaultLongRunningTaskManager(PermissionManager permissionManager, ActivityMonitor activityMonitor)
Method Detail |
---|
public LongRunningTaskId queueLongRunningTask(com.atlassian.core.task.longrunning.LongRunningTask task)
LongRunningTaskManagerInternal
LongRunningTaskManagerInternal.startIfQueued(com.atlassian.confluence.util.longrunning.LongRunningTaskId)
is called.
queueLongRunningTask
in interface LongRunningTaskManagerInternal
task
- the task to perform
public void startIfQueued(LongRunningTaskId taskId)
LongRunningTaskManagerInternal
startIfQueued
in interface LongRunningTaskManagerInternal
taskId
- the ID of the taskpublic LongRunningTaskId startLongRunningTask(com.atlassian.user.User user, com.atlassian.core.task.longrunning.LongRunningTask task)
LongRunningTaskManager
startLongRunningTask
in interface LongRunningTaskManager
user
- the user responsible for the tasktask
- the task to perform
public com.atlassian.core.task.longrunning.LongRunningTask getLongRunningTask(com.atlassian.user.User user, LongRunningTaskId taskId)
getLongRunningTask
in interface LongRunningTaskManager
user
- the user responsible for the tasktaskId
- the ID of the task
public PageResponse<LongTaskStatus> getAllTasks(ConfluenceUser asUser, LimitedRequest request)
LongRunningTaskManagerInternal
getAllTasks
in interface LongRunningTaskManagerInternal
public List<LongTaskStatus> removeComplete()
LongRunningTaskManagerInternal
removeComplete
in interface LongRunningTaskManagerInternal
public 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 LongRunningTaskManager
taskId
- the ID of the task to remove.public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
public void stop(long timeout, TimeUnit unit) throws TimeoutException
LongRunningTaskManager
stop
in interface LongRunningTaskManager
timeout
- the time to wait for running tasks to completeunit
- the unit of measurement for the timeout parameter
TimeoutException
- if the timeout is exceededpublic void resume()
LongRunningTaskManager
LongRunningTaskManager.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 LongRunningTaskManager
protected void taskFinished(LongRunningTaskId taskId)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |