|
||||||||||
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()
|
Method Summary | |
---|---|
void |
destroy()
|
com.atlassian.core.task.longrunning.LongRunningTask |
getLongRunningTask(com.atlassian.user.User user,
LongRunningTaskId id)
gets a long running task with the given Id that was registered either by this user or the anonymous user. |
void |
resume()
Resume accepting long-running tasks after LongRunningTaskManager.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,
java.util.concurrent.TimeUnit unit)
Stop accepting new long running tasks. |
void |
stopTrackingLongRunningTask(LongRunningTaskId id)
Clean up an old task. |
protected void |
taskFinished(LongRunningTaskId id)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultLongRunningTaskManager()
Method Detail |
---|
public 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 id)
getLongRunningTask
in interface LongRunningTaskManager
user
- the user responsible for the taskid
- the ID of the task
public void stopTrackingLongRunningTask(LongRunningTaskId id)
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
id
- the ID of the task to remove.public void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
public void stop(long timeout, java.util.concurrent.TimeUnit unit) throws java.util.concurrent.TimeoutException
LongRunningTaskManager
stop
in interface LongRunningTaskManager
timeout
- the time to wait for running tasks to completeunit
- the unit of measurement for the timeout parameter
java.util.concurrent.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 id)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |