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


Java JobInstance.setVersion方法代码示例

本文整理汇总了Java中org.springframework.batch.core.JobInstance.setVersion方法的典型用法代码示例。如果您正苦于以下问题:Java JobInstance.setVersion方法的具体用法?Java JobInstance.setVersion怎么用?Java JobInstance.setVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.batch.core.JobInstance的用法示例。


在下文中一共展示了JobInstance.setVersion方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createJobInstance

import org.springframework.batch.core.JobInstance; //导入方法依赖的package包/类
/**
 * @param jobId
 *            Set the job id
 * @param jobName
 *            Set the job name
 * @param authorityName
 *            Set the authority name
 * @param version
 *            Set the version
 */
public void createJobInstance(String jobId,
		String jobName, String authorityName,
		String version) {
	enableAuthentication();
	Long id = null;
	if (jobId != null && jobId.length() > 0) {
		id = Long.parseLong(jobId);
	}
	Integer v = null;
	if (version != null && version.length() > 0) {
		v = Integer.parseInt(version);
	}
	Map<String, JobParameter> jobParameterMap = new HashMap<String, JobParameter>();

	if (authorityName != null && authorityName.length() > 0) {
		jobParameterMap.put("authority.name", new JobParameter(
				authorityName));
	}
	JobParameters jobParameters = new JobParameters(jobParameterMap);
	JobInstance jobInstance = new JobInstance(id, jobParameters, jobName);
	jobInstance.setVersion(v);
	data.push(jobInstance);
	jobInstanceService.save(jobInstance);
	disableAuthentication();
}
 
开发者ID:RBGKew,项目名称:eMonocot,代码行数:36,代码来源:TestDataManager.java

示例2: testWriteJobInstance

import org.springframework.batch.core.JobInstance; //导入方法依赖的package包/类
/**
 *
 * @throws Exception
 *             if there is a problem serializing the object
 */
@Test
public void testWriteJobInstance() throws Exception {
	Map<String, JobParameter> jobParameterMap
	= new HashMap<String, JobParameter>();
	jobParameterMap.put("authority.name", new JobParameter("test"));
	JobInstance jobInstance = new JobInstance(1L, new JobParameters(
			jobParameterMap), "testJob");
	jobInstance.setVersion(1);

	try {
		objectMapper.writeValueAsString(jobInstance);
	} catch (Exception e) {
		fail("No exception expected here");
	}

}
 
开发者ID:RBGKew,项目名称:eMonocot,代码行数:22,代码来源:JsonConversionTest.java

示例3: mapRow

import org.springframework.batch.core.JobInstance; //导入方法依赖的package包/类
/**
 * @param resultSet
 *            Set the result set
 * @param rowNumber
 *            Set the row number
 * @throws SQLException
 *             if there is a problem
 * @return a job execution instance
 */
public final JobInstance mapRow(final ResultSet resultSet,
		final int rowNumber) throws SQLException {
	JobInstance jobInstance = new JobInstance(resultSet.getBigDecimal(
			"JOB_INSTANCE_ID").longValue(), jobParameters,
			resultSet.getString("JOB_NAME"));
	BigDecimal version = resultSet.getBigDecimal("VERSION");
	if (version != null) {
		jobInstance.setVersion(version.intValue());
	}
	return jobInstance;
}
 
开发者ID:RBGKew,项目名称:eMonocot,代码行数:21,代码来源:JobInstanceDaoImpl.java

示例4: testJobExecution

import org.springframework.batch.core.JobInstance; //导入方法依赖的package包/类
/**
 *
 */
@Test
public final void testJobExecution() {
	Map<String, JobParameter> jobParametersMap = new HashMap<String, JobParameter>();
	jobParametersMap.put("authority.name", new JobParameter("test"));
	JobInstance jobInstance = new JobInstance(1L, new JobParameters(
			jobParametersMap), "testJob");
	jobInstance.setVersion(1);
	jobInstanceDao.save(jobInstance);

	JobExecution jobExecution = new JobExecution(jobInstance, 1L);
	jobExecution.setCreateTime(new Date());
	jobExecutionDao.save(jobExecution);

	jobExecutionDao.delete(1L);
	jobInstanceDao.delete(1L);
}
 
开发者ID:RBGKew,项目名称:eMonocot,代码行数:20,代码来源:RestApiFunctionalTest.java

示例5: AdaptedJobInstance

import org.springframework.batch.core.JobInstance; //导入方法依赖的package包/类
public AdaptedJobInstance(JobInstance jobInstance) {
	this.id = jobInstance.getId();
	if (jobInstance.getVersion() == null) {
		jobInstance.setVersion(0);
	} else {
		this.setVersion(jobInstance.getVersion());
	}
	this.jobName = jobInstance.getJobName();
}
 
开发者ID:marklogic-community,项目名称:marklogic-spring-batch,代码行数:10,代码来源:AdaptedJobInstance.java

示例6: unmarshal

import org.springframework.batch.core.JobInstance; //导入方法依赖的package包/类
@Override
public JobInstance unmarshal(AdaptedJobInstance v) throws Exception {
    JobInstance jobInstance = new JobInstance(v.getId(), v.getJobName());
    jobInstance.setVersion(v.getVersion());
    return jobInstance;
}
 
开发者ID:marklogic-community,项目名称:marklogic-spring-batch,代码行数:7,代码来源:JobInstanceAdapter.java


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