Class DefaultTaskConfigurer
java.lang.Object
org.springframework.cloud.task.configuration.DefaultTaskConfigurer
- All Implemented Interfaces:
TaskConfigurer
- Direct Known Subclasses:
CustomTaskConfigurer
Default implementation of the TaskConfigurer interface. If no
TaskConfigurer
implementation is present, then this configuration will be used. The following defaults
will be used:
SimpleTaskRepositoryis the defaultTaskRepositoryreturned. If a data source is present then a data will be stored in the databaseJdbcTaskExecutionDaoelse it will be stored in a mapMapTaskExecutionDao.
- Author:
- Glenn Renfro, Michael Minella, Mahmoud Ben Hassine
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTaskConfigurer(String tablePrefix) Initializes the DefaultTaskConfigurer.DefaultTaskConfigurer(DataSource dataSource) Initializes the DefaultTaskConfigurer and sets the default table prefix toTaskProperties.DEFAULT_TABLE_PREFIX.DefaultTaskConfigurer(DataSource dataSource, String tablePrefix, org.springframework.context.ApplicationContext context) Initializes the DefaultTaskConfigurer. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves theDataSourcethat will be used for task operations.Create aTaskExplorerfor the task.Create aTaskRepositoryfor the Task.org.springframework.transaction.PlatformTransactionManagerCreate aPlatformTransactionManagerfor use with theTaskRepository.
-
Constructor Details
-
DefaultTaskConfigurer
public DefaultTaskConfigurer() -
DefaultTaskConfigurer
Initializes the DefaultTaskConfigurer and sets the default table prefix toTaskProperties.DEFAULT_TABLE_PREFIX.- Parameters:
dataSource- references theDataSourceto be used as the Task repository. If none is provided, a Map will be used (not recommended for production use).
-
DefaultTaskConfigurer
Initializes the DefaultTaskConfigurer.- Parameters:
tablePrefix- the prefix to apply to the task table names used by task infrastructure.
-
DefaultTaskConfigurer
public DefaultTaskConfigurer(DataSource dataSource, String tablePrefix, org.springframework.context.ApplicationContext context) Initializes the DefaultTaskConfigurer.- Parameters:
dataSource- references theDataSourceto be used as the Task repository. If none is provided, a Map will be used (not recommended for production use).tablePrefix- the prefix to apply to the task table names used by task infrastructure.context- the context to be used.
-
-
Method Details
-
getTaskRepository
Description copied from interface:TaskConfigurerCreate aTaskRepositoryfor the Task.- Specified by:
getTaskRepositoryin interfaceTaskConfigurer- Returns:
- A TaskRepository
-
getTaskExplorer
Description copied from interface:TaskConfigurerCreate aTaskExplorerfor the task.- Specified by:
getTaskExplorerin interfaceTaskConfigurer- Returns:
- a
TaskExplorer
-
getTaskDataSource
Description copied from interface:TaskConfigurerRetrieves theDataSourcethat will be used for task operations. If a DataSource is not being used for the implemented TaskConfigurer this method will return null.- Specified by:
getTaskDataSourcein interfaceTaskConfigurer- Returns:
DataSourcethat will be used for task operations.
-
getTransactionManager
public org.springframework.transaction.PlatformTransactionManager getTransactionManager()Description copied from interface:TaskConfigurerCreate aPlatformTransactionManagerfor use with theTaskRepository.- Specified by:
getTransactionManagerin interfaceTaskConfigurer- Returns:
- A
PlatformTransactionManager
-