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:
SimpleTaskRepository
is the defaultTaskRepository
returned. If a data source is present then a data will be stored in the databaseJdbcTaskExecutionDao
else it will be stored in a mapMapTaskExecutionDao
.
- Author:
- Glenn Renfro, Michael Minella, Mahmoud Ben Hassine
-
Constructor Summary
ConstructorDescriptionDefaultTaskConfigurer
(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 theDataSource
that will be used for task operations.Create aTaskExplorer
for the task.Create aTaskNameResolver
for use with the task application.Create aTaskRepository
for the Task.org.springframework.transaction.PlatformTransactionManager
Create aPlatformTransactionManager
for 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 theDataSource
to 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 theDataSource
to 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:TaskConfigurer
Create aTaskRepository
for the Task.- Specified by:
getTaskRepository
in interfaceTaskConfigurer
- Returns:
- A TaskRepository
-
getTaskExplorer
Description copied from interface:TaskConfigurer
Create aTaskExplorer
for the task.- Specified by:
getTaskExplorer
in interfaceTaskConfigurer
- Returns:
- a
TaskExplorer
-
getTaskDataSource
Description copied from interface:TaskConfigurer
Retrieves theDataSource
that will be used for task operations. If a DataSource is not being used for the implemented TaskConfigurer this method will return null.- Specified by:
getTaskDataSource
in interfaceTaskConfigurer
- Returns:
DataSource
that will be used for task operations.
-
getTaskNameResolver
Description copied from interface:TaskConfigurer
Create aTaskNameResolver
for use with the task application.- Specified by:
getTaskNameResolver
in interfaceTaskConfigurer
- Returns:
- A
TaskNameResolver
-
getTransactionManager
public org.springframework.transaction.PlatformTransactionManager getTransactionManager()Description copied from interface:TaskConfigurer
Create aPlatformTransactionManager
for use with theTaskRepository
.- Specified by:
getTransactionManager
in interfaceTaskConfigurer
- Returns:
- A
PlatformTransactionManager
-