当前位置: 首页>>代码示例>>Java>>正文


Java TaskRepository类代码示例

本文整理汇总了Java中org.springframework.cloud.task.repository.TaskRepository的典型用法代码示例。如果您正苦于以下问题:Java TaskRepository类的具体用法?Java TaskRepository怎么用?Java TaskRepository使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TaskRepository类属于org.springframework.cloud.task.repository包,在下文中一共展示了TaskRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: taskConfigurer

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
@Bean
public TaskConfigurer taskConfigurer() {
	return new TaskConfigurer() {
		@Override
		public TaskRepository getTaskRepository() {
			return null;
		}

		@Override
		public PlatformTransactionManager getTransactionManager() {
			return null;
		}

		@Override
		public TaskExplorer getTaskExplorer() {
			return mock(TaskExplorer.class);
		}

		@Override
		public DataSource getTaskDataSource() {
			return mock(DataSource.class);
		}
	};
}
 
开发者ID:spring-cloud-task-app-starters,项目名称:composed-task-runner,代码行数:25,代码来源:ComposedTaskRunnerStepFactoryTests.java

示例2: TaskLifecycleListener

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
/**
 * @param taskRepository The repository to record executions in.
 */
public TaskLifecycleListener(TaskRepository taskRepository,
		TaskNameResolver taskNameResolver,
		ApplicationArguments applicationArguments, TaskExplorer taskExplorer,
		TaskProperties taskProperties) {
	Assert.notNull(taskRepository, "A taskRepository is required");
	Assert.notNull(taskNameResolver, "A taskNameResolver is required");
	Assert.notNull(taskExplorer, "A taskExplorer is required");
	Assert.notNull(taskProperties, "TaskProperties is required");

	this.taskRepository = taskRepository;
	this.taskNameResolver = taskNameResolver;
	this.applicationArguments = applicationArguments;
	this.taskExplorer = taskExplorer;
	this.taskProperties = taskProperties;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-task,代码行数:19,代码来源:TaskLifecycleListener.java

示例3: DefaultTaskService

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
/**
 * Initializes the {@link DefaultTaskService}.
 *
 * @param dataSourceProperties the data source properties.
 * @param taskDefinitionRepository the {@link TaskDefinitionRepository} this service will
 * use for task CRUD operations.
 * @param taskExecutionRepository the repository this service will use for deployment IDs.
 * @param taskExplorer the explorer this service will use to lookup task executions
 * @param registry URI registry this service will use to look up app URIs.
 * @param resourceLoader the {@link ResourceLoader} that will resolve URIs to
 * {@link Resource}s.
 * @param taskLauncher the launcher this service will use to launch task apps.
 * @param metaDataResolver the metadata resolver
 * @param taskConfigurationProperties the properties used to define the behavior of tasks
 * @param deploymentIdRepository the repository that maps deployment keys to IDs
 * @param dataflowServerUri the data flow server URI
 */
public DefaultTaskService(DataSourceProperties dataSourceProperties,
		TaskDefinitionRepository taskDefinitionRepository, TaskExplorer taskExplorer,
		TaskRepository taskExecutionRepository, AppRegistryCommon registry, ResourceLoader resourceLoader,
		TaskLauncher taskLauncher, ApplicationConfigurationMetadataResolver metaDataResolver,
		TaskConfigurationProperties taskConfigurationProperties, DeploymentIdRepository deploymentIdRepository,
		String dataflowServerUri) {
	Assert.notNull(dataSourceProperties, "DataSourceProperties must not be null");
	Assert.notNull(taskDefinitionRepository, "TaskDefinitionRepository must not be null");
	Assert.notNull(taskExecutionRepository, "TaskExecutionRepository must not be null");
	Assert.notNull(taskExplorer, "TaskExplorer must not be null");
	Assert.notNull(registry, "UriRegistry must not be null");
	Assert.notNull(resourceLoader, "ResourceLoader must not be null");
	Assert.notNull(taskLauncher, "TaskLauncher must not be null");
	Assert.notNull(metaDataResolver, "metaDataResolver must not be null");
	Assert.notNull(taskConfigurationProperties, "taskConfigurationProperties must not be null");
	Assert.notNull(deploymentIdRepository, "deploymentIdRepository must not be null");
	this.dataSourceProperties = dataSourceProperties;
	this.taskDefinitionRepository = taskDefinitionRepository;
	this.taskExecutionRepository = taskExecutionRepository;
	this.taskExplorer = taskExplorer;
	this.registry = registry;
	this.taskLauncher = taskLauncher;
	this.resourceLoader = resourceLoader;
	this.whitelistProperties = new WhitelistProperties(metaDataResolver);
	this.taskConfigurationProperties = taskConfigurationProperties;
	this.deploymentIdRepository = deploymentIdRepository;
	this.dataflowServerUri = dataflowServerUri;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:46,代码来源:DefaultTaskService.java

示例4: taskService

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
@Bean
@ConditionalOnBean(TaskDefinitionRepository.class)
public TaskService taskService(TaskDefinitionRepository repository, TaskExplorer taskExplorer,
		TaskRepository taskExecutionRepository, AppRegistryCommon registry, DelegatingResourceLoader resourceLoader,
		TaskLauncher taskLauncher, ApplicationConfigurationMetadataResolver metadataResolver,
		TaskConfigurationProperties taskConfigurationProperties, DeploymentIdRepository deploymentIdRepository) {
	return new DefaultTaskService(dataSourceProperties, repository, taskExplorer, taskExecutionRepository, registry,
			resourceLoader, taskLauncher, metadataResolver, taskConfigurationProperties, deploymentIdRepository,
			this.dataflowServerUri);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:11,代码来源:TaskConfiguration.java

示例5: taskService

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
@Bean
public TaskService taskService(ApplicationConfigurationMetadataResolver metadataResolver,
		TaskRepository taskExecutionRepository, DeploymentIdRepository deploymentIdRepository,
		AppRegistryCommon appRegistry, DelegatingResourceLoader delegatingResourceLoader) {
	return new DefaultTaskService(new DataSourceProperties(), taskDefinitionRepository(), taskExplorer(),
			taskExecutionRepository, appRegistry, delegatingResourceLoader, taskLauncher(), metadataResolver,
			new TaskConfigurationProperties(), deploymentIdRepository, null);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:9,代码来源:TestDependencies.java

示例6: defaultTaskService

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
@Bean
public DefaultTaskService defaultTaskService(TaskDefinitionRepository taskDefinitionRepository, TaskExplorer taskExplorer,
		TaskRepository taskExecutionRepository, AppRegistry appRegistry,
		ResourceLoader resourceLoader, TaskLauncher taskLauncher,
		ApplicationConfigurationMetadataResolver metadataResolver) {
	return new DefaultTaskService(dataSourceProperties, taskDefinitionRepository, taskExplorer,
			taskExecutionRepository, appRegistry, resourceLoader, taskLauncher, metadataResolver,
			new TaskConfigurationProperties(), new InMemoryDeploymentIdRepository(), null);

}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:11,代码来源:TaskServiceDependencies.java

示例7: verifyTaskRepositoryConstructor

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
private void verifyTaskRepositoryConstructor(Integer maxExitMessage, Integer maxErrorMessage,
		TaskRepository taskRepository) {
	TaskExecution expectedTaskExecution = TaskExecutionCreator.createAndStoreTaskExecutionNoParams(taskRepository);
	expectedTaskExecution.setErrorMessage(new String(new char[maxErrorMessage+ 1]));
	expectedTaskExecution.setExitMessage(new String(new char[maxExitMessage + 1]));
	expectedTaskExecution.setEndTime(new Date());

	TaskExecution actualTaskExecution = completeTaskExecution(expectedTaskExecution, taskRepository);
	assertEquals(maxErrorMessage.intValue(), actualTaskExecution.getErrorMessage().length());
	assertEquals(maxExitMessage.intValue(), actualTaskExecution.getExitMessage().length());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-task,代码行数:12,代码来源:SimpleTaskRepositoryJdbcTests.java

示例8: createAndStoreTaskExecutionWithParams

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
/**
 * Creates a sample TaskExecution and stores it in the taskRepository with params.
 *
 * @param taskRepository the taskRepository where the taskExecution should be stored.
 * @return the taskExecution created.
 */
public static TaskExecution createAndStoreTaskExecutionWithParams(TaskRepository taskRepository) {
	TaskExecution expectedTaskExecution = TestVerifierUtils.createSampleTaskExecutionNoArg();
	List<String> params = new ArrayList<String>();
	params.add(UUID.randomUUID().toString());
	params.add(UUID.randomUUID().toString());
	expectedTaskExecution.setArguments(params);
	expectedTaskExecution = taskRepository.createTaskExecution(expectedTaskExecution);
	return expectedTaskExecution;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-task,代码行数:16,代码来源:TaskExecutionCreator.java

示例9: completeExecution

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
/**
 * Updates a sample TaskExecution in the taskRepository.
 *
 * @param taskRepository the taskRepository where the taskExecution should be updated.
 * @return the taskExecution created.
 */
public static TaskExecution completeExecution(TaskRepository taskRepository,
		TaskExecution expectedTaskExecution) {
	return taskRepository.completeTaskExecution(expectedTaskExecution.getExecutionId(),
			expectedTaskExecution.getExitCode(), expectedTaskExecution.getEndTime(),
			expectedTaskExecution.getExitMessage(), expectedTaskExecution.getErrorMessage());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-task,代码行数:13,代码来源:TaskExecutionCreator.java

示例10: taskRepository

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
@Bean
public TaskRepository taskRepository(DataSource dataSource) {
	return new SimpleTaskRepository(new TaskExecutionDaoFactoryBean(dataSource));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:5,代码来源:TaskConfiguration.java

示例11: taskRepository

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
@Bean
public TaskRepository taskRepository() {
	return new SimpleTaskRepository(new TaskExecutionDaoFactoryBean());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:5,代码来源:TestDependencies.java

示例12: taskRepository

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
@Bean
public TaskRepository taskRepository(TaskExecutionDaoFactoryBean daoFactoryBean) {
	return new SimpleTaskRepository(daoFactoryBean);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:5,代码来源:TaskServiceDependencies.java

示例13: taskRepository

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
@Bean
public TaskRepository taskRepository() {
	return mock(TaskRepository.class);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:5,代码来源:DataFlowServerConfigurationTests.java

示例14: getTaskRepository

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
@Override
public TaskRepository getTaskRepository() {
	return this.taskRepository;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-task,代码行数:5,代码来源:DefaultTaskConfigurer.java

示例15: taskRepository

import org.springframework.cloud.task.repository.TaskRepository; //导入依赖的package包/类
@Bean
public TaskRepository taskRepository(){
	return this.taskRepository;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-task,代码行数:5,代码来源:SimpleTaskConfiguration.java


注:本文中的org.springframework.cloud.task.repository.TaskRepository类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。