Class AbstractWorkflow
- java.lang.Object
-
- fr.ens.biologie.genomique.eoulsan.core.workflow.AbstractWorkflow
-
- All Implemented Interfaces:
Workflow
,Serializable
- Direct Known Subclasses:
CommandWorkflow
public abstract class AbstractWorkflow extends Object implements Workflow
This class define a Workflow. This class must be extended by a class to be able to work with a specific workflow file format.- Since:
- 2.0
- Author:
- Laurent Jourdren
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
WORKFLOW_COPY_FILENAME
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractWorkflow(ExecutorArguments executionArguments, Design design)
Protected constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkDirectories()
Check directories needed by the workflow.void
createEoulsanDataDirectoryIfRequired()
Create an "eoulsan-data" directory if mapper indexes or genome description storage has not been defined.Thread
createShutdownHookThread()
Create a shutdown hook thread.void
deleteOnExit(DataFile file)
Delete a file on the exit of the workflow.void
execute()
Execute the workflow.protected Step
getCheckerStep()
Get checker step.Design
getDesign()
Get the design used by the workflow.Step
getDesignStep()
Get the design step of the workflow.Step
getFirstStep()
Get the first step of the workflow (after generator steps).Step
getRootStep()
Get the first steps of the workflow.Set<Step>
getSteps()
Get the steps of the workflow.WorkflowContext
getWorkflowContext()
Get the real Context object.protected void
register(AbstractStep step)
Register a step of the workflow.protected void
saveConfigurationFiles()
Save configuration files.void
stepStateEvent(fr.ens.biologie.genomique.eoulsan.core.workflow.StepStateEvent event)
Listen StepState events.
-
-
-
Field Detail
-
WORKFLOW_COPY_FILENAME
protected static final String WORKFLOW_COPY_FILENAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractWorkflow
protected AbstractWorkflow(ExecutorArguments executionArguments, Design design) throws EoulsanException
Protected constructor.- Parameters:
executionArguments
- execution argumentsdesign
- design to use for the workflow- Throws:
EoulsanException
- if an error occurs while configuring the workflow
-
-
Method Detail
-
getDesign
public Design getDesign()
Description copied from interface:Workflow
Get the design used by the workflow.
-
getSteps
public Set<Step> getSteps()
Description copied from interface:Workflow
Get the steps of the workflow.
-
getRootStep
public Step getRootStep()
Description copied from interface:Workflow
Get the first steps of the workflow.- Specified by:
getRootStep
in interfaceWorkflow
- Returns:
- the root step of the workflow
-
getDesignStep
public Step getDesignStep()
Description copied from interface:Workflow
Get the design step of the workflow.- Specified by:
getDesignStep
in interfaceWorkflow
- Returns:
- the design step of the workflow
-
getFirstStep
public Step getFirstStep()
Description copied from interface:Workflow
Get the first step of the workflow (after generator steps).- Specified by:
getFirstStep
in interfaceWorkflow
- Returns:
- the first step of the workflow
-
getCheckerStep
protected Step getCheckerStep()
Get checker step.- Returns:
- the checker step
-
getWorkflowContext
public WorkflowContext getWorkflowContext()
Get the real Context object. This method is useful to redefine context values like base directory.- Returns:
- The Context object
-
register
protected void register(AbstractStep step)
Register a step of the workflow.- Parameters:
step
- step to register
-
stepStateEvent
public void stepStateEvent(fr.ens.biologie.genomique.eoulsan.core.workflow.StepStateEvent event)
Listen StepState events. Update the status of a step. This method is used by steps to inform the workflow object that the status of the step has been changed.- Parameters:
event
- the event to handle
-
deleteOnExit
public void deleteOnExit(DataFile file)
Description copied from interface:Workflow
Delete a file on the exit of the workflow.- Specified by:
deleteOnExit
in interfaceWorkflow
- Parameters:
file
- file to remove
-
execute
public void execute() throws EoulsanException
Execute the workflow.- Throws:
EoulsanException
- if an error occurs while executing the workflow
-
createShutdownHookThread
public Thread createShutdownHookThread()
Create a shutdown hook thread.- Returns:
- a new thread
-
saveConfigurationFiles
protected void saveConfigurationFiles() throws EoulsanException
Save configuration files.- Throws:
EoulsanException
- if an error while writing files
-
checkDirectories
public void checkDirectories() throws EoulsanException
Check directories needed by the workflow.- Throws:
EoulsanException
- if an error about the directories is found
-
createEoulsanDataDirectoryIfRequired
public void createEoulsanDataDirectoryIfRequired() throws EoulsanException
Create an "eoulsan-data" directory if mapper indexes or genome description storage has not been defined.- Throws:
EoulsanException
- if an error about the directories is found
-
-