public class DefaultTaskService extends Object implements TaskService
TaskService interface. Provide service methods
for Tasks.| Constructor and Description |
|---|
DefaultTaskService(org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties,
TaskDefinitionRepository taskDefinitionRepository,
org.springframework.cloud.task.repository.TaskExplorer taskExplorer,
org.springframework.cloud.task.repository.TaskRepository taskExecutionRepository,
AppRegistry registry,
ResourceLoader resourceLoader,
org.springframework.cloud.deployer.spi.task.TaskLauncher taskLauncher,
ApplicationConfigurationMetadataResolver metaDataResolver)
Initializes the
DefaultTaskService. |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanupExecution(long id)
Cleanup the resources that resulted from running the task with the given execution id.
|
long |
executeTask(String taskName,
Map<String,String> taskDeploymentProperties,
List<String> commandLineArgs)
Execute a task with the provided task name and optional runtime properties.
|
public DefaultTaskService(org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties,
TaskDefinitionRepository taskDefinitionRepository,
org.springframework.cloud.task.repository.TaskExplorer taskExplorer,
org.springframework.cloud.task.repository.TaskRepository taskExecutionRepository,
AppRegistry registry,
ResourceLoader resourceLoader,
org.springframework.cloud.deployer.spi.task.TaskLauncher taskLauncher,
ApplicationConfigurationMetadataResolver metaDataResolver)
DefaultTaskService.dataSourceProperties - the data source properties.taskDefinitionRepository - the TaskDefinitionRepository this service will use for
task CRUD operations.taskExecutionRepository - the repository this service will use for deployment
IDs.taskExplorer - the explorer this service will use to lookup task executionsregistry - URI registry this service will use to look up app URIs.resourceLoader - the ResourceLoader that will resolve URIs to
Resources.taskLauncher - the launcher this service will use to launch task apps.public long executeTask(String taskName, Map<String,String> taskDeploymentProperties, List<String> commandLineArgs)
TaskServiceexecuteTask in interface TaskServicetaskName - Name of the task. Must not be null or empty.taskDeploymentProperties - Optional deployment properties. Must not be null.commandLineArgs - Optional runtime commandline argumentspublic void cleanupExecution(long id)
TaskServicecleanupExecution in interface TaskServiceCopyright © 2017 Pivotal Software, Inc.. All rights reserved.