Package com.atlassian.jira.task
Interface ImportTaskManager
- All Known Implementing Classes:
ImportTaskManagerImpl
public interface ImportTaskManager
A simplified version of the
TaskManager. This interface should only be used for data imports.
Implementations should *not* rely on any external dependencies since they will get refreshed during a data import
which can cause all sorts of issues during an import. Also depending on any external dependencies will double memory
consumption potentially during an import.- Since:
- v4.4
-
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.
-
Method Details
-
getTask
Returns theTaskDescriptorof the current import task that's running- 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.
-
submitTask
<V extends Serializable> TaskDescriptor<V> submitTask(@Nonnull Callable<V> callable, String taskName) throws RejectedExecutionException This 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.- 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.AlreadyExecutingException- if another import task is already running in the task manager.
-
submitTask
<V extends Serializable> TaskDescriptor<V> submitTask(@Nonnull Callable<V> callable, String taskName, @Nullable SpanningOperation spanningOperation) throws RejectedExecutionException This 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.- 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.AlreadyExecutingException- if another import task is already running in the task manager.
-
shutdownNow
void shutdownNow()Attempts to aggressively stop the executing tasks and shuts down the underlying thread pool. -
prepareCachedResourceBundleStrings
Prepares a set of cached I18n strings used by import progress page (JRADEV-22513)- Parameters:
locale-
-
clearCachedResourceBundleStrings
void clearCachedResourceBundleStrings()Clears a set of cached I18n strings used by import progress page (JRADEV-22513) -
getCachedResourceBundleStrings
Returns a set of cached I18n strings used by import progress page (JRADEV-22513)- Returns:
-