Class PipelineExecutorTaskManagerImpl
- java.lang.Object
-
- org.guvnor.ala.pipeline.execution.impl.PipelineExecutorTaskManagerImpl
-
- All Implemented Interfaces:
PipelineExecutorTaskManager
@ApplicationScoped public class PipelineExecutorTaskManagerImpl extends Object implements PipelineExecutorTaskManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classPipelineExecutorTaskManagerImpl.TaskEntry-
Nested classes/interfaces inherited from interface org.guvnor.ala.pipeline.execution.PipelineExecutorTaskManager
PipelineExecutorTaskManager.ExecutionMode
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,PipelineExecutorTaskManagerImpl.TaskEntry>currentTasksprotected static intDEFAULT_THREAD_POOL_SIZEprotected ExecutorServiceexecutorprotected List<PipelineEventListener>externalListenersprotected Map<String,Future<?>>futureTaskMapprotected PipelineEventListenerlocalListenerprotected PipelineExecutorpipelineExecutorprotected PipelineExecutorRegistrypipelineExecutorRegistryprotected PipelineRegistrypipelineRegistryprotected PipelineExecutorTaskManagerImplHelpertaskManagerHelperprotected static StringTHREAD_POOL_SIZE_PROPERTY_NAME
-
Constructor Summary
Constructors Constructor Description PipelineExecutorTaskManagerImpl()PipelineExecutorTaskManagerImpl(PipelineRegistry pipelineRegistry, javax.enterprise.inject.Instance<ConfigExecutor> configExecutorInstance, javax.enterprise.inject.Instance<PipelineEventListener> pipelineEventListenerInstance, PipelineExecutorRegistry pipelineExecutorRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(String taskId)Deletes a pipeline executor task that is in FINISHED, STOPPED or ERROR status.protected voiddestroy()voiddestroy(String taskId)Destroys a pipeline executor task that was launched in ASYNCHRONOUS independently of the execution status.Stringexecute(PipelineExecutorTaskDef taskDef, PipelineExecutorTaskManager.ExecutionMode executionMode)Starts the execution of a task based on the taskDef provided as parameter.protected voidinit()voidstop(String taskId)Stops a pipeline executor task that was launched in ASYNCHRONOUS mode that is in RUNNING or SCHEDULED status.
-
-
-
Field Detail
-
DEFAULT_THREAD_POOL_SIZE
protected static final int DEFAULT_THREAD_POOL_SIZE
- See Also:
- Constant Field Values
-
THREAD_POOL_SIZE_PROPERTY_NAME
protected static final String THREAD_POOL_SIZE_PROPERTY_NAME
- See Also:
- Constant Field Values
-
executor
protected ExecutorService executor
-
externalListeners
protected List<PipelineEventListener> externalListeners
-
pipelineExecutor
protected PipelineExecutor pipelineExecutor
-
currentTasks
protected final Map<String,PipelineExecutorTaskManagerImpl.TaskEntry> currentTasks
-
pipelineExecutorRegistry
protected PipelineExecutorRegistry pipelineExecutorRegistry
-
pipelineRegistry
protected PipelineRegistry pipelineRegistry
-
localListener
protected PipelineEventListener localListener
-
taskManagerHelper
protected PipelineExecutorTaskManagerImplHelper taskManagerHelper
-
-
Constructor Detail
-
PipelineExecutorTaskManagerImpl
public PipelineExecutorTaskManagerImpl()
-
PipelineExecutorTaskManagerImpl
@Inject public PipelineExecutorTaskManagerImpl(PipelineRegistry pipelineRegistry, javax.enterprise.inject.Instance<ConfigExecutor> configExecutorInstance, javax.enterprise.inject.Instance<PipelineEventListener> pipelineEventListenerInstance, PipelineExecutorRegistry pipelineExecutorRegistry)
-
-
Method Detail
-
init
@PostConstruct protected void init()
-
destroy
@PreDestroy protected void destroy()
-
execute
public String execute(PipelineExecutorTaskDef taskDef, PipelineExecutorTaskManager.ExecutionMode executionMode)
Description copied from interface:PipelineExecutorTaskManagerStarts the execution of a task based on the taskDef provided as parameter.- Specified by:
executein interfacePipelineExecutorTaskManager- Parameters:
taskDef- a task definition to be executed.executionMode- indicates if the task should be executed in synchronous or asynchronous mode.- Returns:
- returns uuid of the created task.
- See Also:
PipelineExecutorTaskDef
-
stop
public void stop(String taskId) throws PipelineExecutorException
Description copied from interface:PipelineExecutorTaskManagerStops a pipeline executor task that was launched in ASYNCHRONOUS mode that is in RUNNING or SCHEDULED status.- Specified by:
stopin interfacePipelineExecutorTaskManager- Parameters:
taskId- the id of the task to stop.- Throws:
PipelineExecutorException- throws exceptions when a task that fulfil the conditions couldn't be found.
-
destroy
public void destroy(String taskId) throws PipelineExecutorException
Description copied from interface:PipelineExecutorTaskManagerDestroys a pipeline executor task that was launched in ASYNCHRONOUS independently of the execution status. All information related to the task is also removed from the PipelineExecutorRegistry.- Specified by:
destroyin interfacePipelineExecutorTaskManager- Parameters:
taskId- the id of the task to be destroyed.- Throws:
PipelineExecutorException- throws exceptions when a task that fulfil the conditions couldn't be found.
-
delete
public void delete(String taskId) throws PipelineExecutorException
Description copied from interface:PipelineExecutorTaskManagerDeletes a pipeline executor task that is in FINISHED, STOPPED or ERROR status. All information related to the task is also removed from the PipelineExecutorRegistry.- Specified by:
deletein interfacePipelineExecutorTaskManager- Parameters:
taskId- the id of the task to be deleted.- Throws:
PipelineExecutorException- throws exceptions when a task that fulfil the conditions couldn't be found.
-
-