本文整理匯總了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);
}