本文整理汇总了Java中org.springframework.cloud.task.repository.dao.TaskExecutionDao类的典型用法代码示例。如果您正苦于以下问题:Java TaskExecutionDao类的具体用法?Java TaskExecutionDao怎么用?Java TaskExecutionDao使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskExecutionDao类属于org.springframework.cloud.task.repository.dao包,在下文中一共展示了TaskExecutionDao类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SimpleTaskRepository
import org.springframework.cloud.task.repository.dao.TaskExecutionDao; //导入依赖的package包/类
public SimpleTaskRepository(FactoryBean<TaskExecutionDao> taskExecutionDaoFactoryBean, Integer maxExitMessageSize,
Integer maxTaskNameSize, Integer maxErrorMessageSize){
Assert.notNull(taskExecutionDaoFactoryBean, "A FactoryBean that provides a TaskExecutionDao is required");
if(maxTaskNameSize != null) {
this.maxTaskNameSize = maxTaskNameSize;
}
if(maxExitMessageSize != null) {
this.maxExitMessageSize = maxExitMessageSize;
}
if(maxErrorMessageSize != null) {
this.maxErrorMessageSize = maxErrorMessageSize;
}
this.taskExecutionDaoFactoryBean = taskExecutionDaoFactoryBean;
}
示例2: getObject
import org.springframework.cloud.task.repository.dao.TaskExecutionDao; //导入依赖的package包/类
@Override
public TaskExecutionDao getObject() throws Exception {
if(this.dao == null) {
if (this.dataSource != null) {
buildTaskExecutionDao(this.dataSource);
}
else {
this.dao = new MapTaskExecutionDao();
}
}
return this.dao;
}
示例3: testMapTaskExecutionDaoWithoutAppContext
import org.springframework.cloud.task.repository.dao.TaskExecutionDao; //导入依赖的package包/类
@Test
public void testMapTaskExecutionDaoWithoutAppContext() throws Exception {
TaskExecutionDaoFactoryBean factoryBean = new TaskExecutionDaoFactoryBean();
TaskExecutionDao taskExecutionDao = factoryBean.getObject();
assertTrue(taskExecutionDao instanceof MapTaskExecutionDao);
TaskExecutionDao taskExecutionDao2 = factoryBean.getObject();
assertTrue(taskExecutionDao == taskExecutionDao2);
}
示例4: testSettingTablePrefix
import org.springframework.cloud.task.repository.dao.TaskExecutionDao; //导入依赖的package包/类
@Test
public void testSettingTablePrefix() throws Exception {
this.context = new AnnotationConfigApplicationContext(DefaultDataSourceConfiguration.class);
DataSource dataSource = this.context.getBean(DataSource.class);
TaskExecutionDaoFactoryBean factoryBean = new TaskExecutionDaoFactoryBean(dataSource, "foo_");
TaskExecutionDao taskExecutionDao = factoryBean.getObject();
assertEquals("foo_", ReflectionTestUtils.getField(taskExecutionDao, "tablePrefix"));
}
示例5: getTaskExecutionDao
import org.springframework.cloud.task.repository.dao.TaskExecutionDao; //导入依赖的package包/类
/**
* Retrieves the taskExecutionDao associated with this repository.
* @return the taskExecutionDao
*/
public TaskExecutionDao getTaskExecutionDao() {
initialize();
return taskExecutionDao;
}
示例6: getObjectType
import org.springframework.cloud.task.repository.dao.TaskExecutionDao; //导入依赖的package包/类
@Override
public Class<?> getObjectType() {
return TaskExecutionDao.class;
}
示例7: testGetObjectType
import org.springframework.cloud.task.repository.dao.TaskExecutionDao; //导入依赖的package包/类
@Test
public void testGetObjectType() {
assertEquals(new TaskExecutionDaoFactoryBean().getObjectType(), TaskExecutionDao.class);
}
示例8: testDefaultDataSourceConfiguration
import org.springframework.cloud.task.repository.dao.TaskExecutionDao; //导入依赖的package包/类
@Test
public void testDefaultDataSourceConfiguration() throws Exception {
this.context = new AnnotationConfigApplicationContext(DefaultDataSourceConfiguration.class);
DataSource dataSource = this.context.getBean(DataSource.class);
TaskExecutionDaoFactoryBean factoryBean = new TaskExecutionDaoFactoryBean(dataSource);
TaskExecutionDao taskExecutionDao = factoryBean.getObject();
assertTrue(taskExecutionDao instanceof JdbcTaskExecutionDao);
TaskExecutionDao taskExecutionDao2 = factoryBean.getObject();
assertTrue(taskExecutionDao == taskExecutionDao2);
}