Package com.atlassian.jira.task
Class ImportTaskManagerImpl
java.lang.Object
com.atlassian.jira.task.ImportTaskManagerImpl
- All Implemented Interfaces:
ImportTaskManager
An implementation of a
ImportTaskManager. This manager uses an ExecutorService to run
submitted tasks.
It should have *no* external dependencies and should *not* be injectable!
- Since:
- 4.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears a set of cached I18n strings used by import progress page (JRADEV-22513)Returns a set of cached I18n strings used by import progress page (JRADEV-22513)<V extends Serializable>
TaskDescriptor<V> getTask()Returns theTaskDescriptorof the current import task that's runningvoidPrepares a set of cached I18n strings used by import progress page (JRADEV-22513)voidAttempts to aggressively stop the executing tasks and shuts down the underlying thread pool.<V extends Serializable>
TaskDescriptor<V> submitTask(Callable<V> callable, String taskName) This submits aCallabletask to the manager which can then be started at the managers discretion, but hopefully very soon.<V extends Serializable>
TaskDescriptor<V> submitTask(Callable<V> callable, String taskName, SpanningOperation spanningOperation) This submits aCallabletask to the manager which can then be started at the managers discretion, but hopefully very soon.
-
Constructor Details
-
ImportTaskManagerImpl
public ImportTaskManagerImpl()
-
-
Method Details
-
prepareCachedResourceBundleStrings
Description copied from interface:ImportTaskManagerPrepares a set of cached I18n strings used by import progress page (JRADEV-22513)- Specified by:
prepareCachedResourceBundleStringsin interfaceImportTaskManager- Parameters:
locale-
-
getCachedResourceBundleStrings
Description copied from interface:ImportTaskManagerReturns a set of cached I18n strings used by import progress page (JRADEV-22513)- Specified by:
getCachedResourceBundleStringsin interfaceImportTaskManager- Returns:
-
clearCachedResourceBundleStrings
public void clearCachedResourceBundleStrings()Description copied from interface:ImportTaskManagerClears a set of cached I18n strings used by import progress page (JRADEV-22513)- Specified by:
clearCachedResourceBundleStringsin interfaceImportTaskManager
-
submitTask
public <V extends Serializable> TaskDescriptor<V> submitTask(@Nonnull Callable<V> callable, String taskName) throws RejectedExecutionException Description copied from interface:ImportTaskManagerThis submits aCallabletask to the manager which can then be started at the managers discretion, but hopefully very soon. TheTaskDescriptorreturned is a snapshot of the task's state when the method returns and will not change to reflect the task's future state changes.- Specified by:
submitTaskin interfaceImportTaskManager- Parameters:
callable- the long running tasktaskName- An i18nized string describing this task- Returns:
- a TaskDescriptor for the new long running task. The returned descriptor is a snapshot of the task state when the method returns and will not reflect any future changes.
- Throws:
RejectedExecutionException- if the task manager is being shutdown and cannot accept new tasks.
-
submitTask
public <V extends Serializable> TaskDescriptor<V> submitTask(@Nonnull Callable<V> callable, String taskName, @Nullable SpanningOperation spanningOperation) throws RejectedExecutionException Description copied from interface:ImportTaskManagerThis submits aCallabletask to the manager which can then be started at the managers discretion, but hopefully very soon. TheTaskDescriptorreturned is a snapshot of the task's state when the method returns and will not change to reflect the task's future state changes.- Specified by:
submitTaskin interfaceImportTaskManager- Parameters:
callable- the long running tasktaskName- An i18nized string describing this taskspanningOperation- Operation that this task is part of- Returns:
- a TaskDescriptor for the new long running task. The returned descriptor is a snapshot of the task state when the method returns and will not reflect any future changes.
- Throws:
RejectedExecutionException- if the task manager is being shutdown and cannot accept new tasks.
-
shutdownNow
public void shutdownNow()Description copied from interface:ImportTaskManagerAttempts to aggressively stop the executing tasks and shuts down the underlying thread pool.- Specified by:
shutdownNowin interfaceImportTaskManager
-
getTask
Description copied from interface:ImportTaskManagerReturns theTaskDescriptorof the current import task that's running- Specified by:
getTaskin interfaceImportTaskManager- Returns:
- a
TaskDescriptoror null if the manager has not such task. The descriptor returned is a snapshot of the task state when the method returns will not reflect any future changes.nullwill be returned when no matching task can be found.
-