Package io.nflow.engine
Class NflowEngine
- java.lang.Object
-
- io.nflow.engine.NflowEngine
-
- All Implemented Interfaces:
AutoCloseable
public class NflowEngine extends Object implements AutoCloseable
NflowEngine starts up nflow-engine with given database and workflow definitions. Use this if you want to start just the nflow-engine.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classNflowEngine.NflowEngineSpringConfig
-
Constructor Summary
Constructors Constructor Description NflowEngine(DataSource dataSource, SQLVariants sqlVariants, Collection<WorkflowDefinition> workflowDefinitions)Starts up the NflowEngine with WorkflowDispatcher running in a thread.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Shuts down the nFlow engine gracefully and returns when the shutdown is complete.HealthCheckServicegetHealthCheckService()MaintenanceServicegetMaintenanceService()StatisticsServicegetStatisticsService()WorkflowDefinitionServicegetWorkflowDefinitionService()WorkflowExecutorServicegetWorkflowExecutorService()WorkflowInstanceServicegetWorkflowInstanceService()booleanisPaused()Returns true if the nFlow engine is currently paused.booleanisRunning()Returns true if the nFlow engine is currently running.voidpause()Pauses a running nFlow engine.voidresume()Resumes a paused nFlow engine.voidstart()For manually starting dispatcher thread.
-
-
-
Constructor Detail
-
NflowEngine
public NflowEngine(DataSource dataSource, SQLVariants sqlVariants, Collection<WorkflowDefinition> workflowDefinitions)
Starts up the NflowEngine with WorkflowDispatcher running in a thread. Property nflow.autostart controls if the thread is started automatically. If nflow.autostart=false, then the thread can be started with start() method.- Parameters:
dataSource- nFlow database data source.sqlVariants- SQL variants for the configured database type.workflowDefinitions- The registered workflow definitions.
-
-
Method Detail
-
start
public void start()
For manually starting dispatcher thread. This starts the nflow-engine if property nflow.autostart=false.
-
pause
public void pause()
Pauses a running nFlow engine.
-
resume
public void resume()
Resumes a paused nFlow engine.
-
isPaused
public boolean isPaused()
Returns true if the nFlow engine is currently paused.- Returns:
- True if engine is currently paused.
-
isRunning
public boolean isRunning()
Returns true if the nFlow engine is currently running.- Returns:
- True if engine is currently running.
-
close
public void close()
Shuts down the nFlow engine gracefully and returns when the shutdown is complete. This NflowEngine instance may not be restarted after close().- Specified by:
closein interfaceAutoCloseable
-
getMaintenanceService
public MaintenanceService getMaintenanceService()
- Returns:
- ArchiveService for nFlow engine.
-
getHealthCheckService
public HealthCheckService getHealthCheckService()
- Returns:
- HealthCheckService for nFlow engine.
-
getStatisticsService
public StatisticsService getStatisticsService()
- Returns:
- StatisticsService for nFlow engine.
-
getWorkflowDefinitionService
public WorkflowDefinitionService getWorkflowDefinitionService()
- Returns:
- WorkflowDefinitionService for nFlow engine.
-
getWorkflowInstanceService
public WorkflowInstanceService getWorkflowInstanceService()
- Returns:
- WorkflowInstanceService for nFlow engine.
-
getWorkflowExecutorService
public WorkflowExecutorService getWorkflowExecutorService()
- Returns:
- WorkflowExecutorService for nFlow engine.
-
-