public interface LongRunningTaskManager
Modifier and Type | Method and Description |
---|---|
com.atlassian.core.task.longrunning.LongRunningTask |
getLongRunningTask(com.atlassian.user.User user,
LongRunningTaskId id)
Retrieve a previously started task.
|
void |
resume()
Resume accepting long-running tasks after
stop(long, java.util.concurrent.TimeUnit) has been called. |
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 id)
Clean up an old task.
|
LongRunningTaskId startLongRunningTask(com.atlassian.user.User user, com.atlassian.core.task.longrunning.LongRunningTask task)
user
- the user responsible for the tasktask
- the task to performIllegalStateException
- if the task manager has been shut downcom.atlassian.core.task.longrunning.LongRunningTask getLongRunningTask(com.atlassian.user.User user, LongRunningTaskId id)
user
- the user responsible for the taskid
- the ID of the taskvoid stopTrackingLongRunningTask(LongRunningTaskId id)
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.
id
- the ID of the task to remove.void stop(long timeout, TimeUnit unit) throws TimeoutException
timeout
- the time to wait for running tasks to completeunit
- the unit of measurement for the timeout parameterTimeoutException
- if the timeout is exceededvoid resume()
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.Copyright © 2003–2015 Atlassian. All rights reserved.