當前位置: 首頁>>代碼示例>>Java>>正文


Java JobExecution.setJobInstance方法代碼示例

本文整理匯總了Java中org.springframework.batch.core.JobExecution.setJobInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java JobExecution.setJobInstance方法的具體用法?Java JobExecution.setJobInstance怎麽用?Java JobExecution.setJobInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.batch.core.JobExecution的用法示例。


在下文中一共展示了JobExecution.setJobInstance方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: unmarshal

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
@Override
public StepExecution unmarshal(AdaptedStepExecution v) throws Exception {
	JobExecution je = new JobExecution(v.getJobExecutionId());
	JobInstance ji = new JobInstance(v.getJobInstanceId(), v.getJobName());
	je.setJobInstance(ji);
	StepExecution step = new StepExecution(v.getStepName(), je);
	step.setId(v.getId());
	step.setStartTime(v.getStartTime());
	step.setEndTime(v.getEndTime());
	step.setReadSkipCount(v.getReadSkipCount());
	step.setWriteSkipCount(v.getWriteSkipCount());
	step.setProcessSkipCount(v.getProcessSkipCount());
	step.setReadCount(v.getReadCount());
	step.setWriteCount(v.getWriteCount());
	step.setFilterCount(v.getFilterCount());
	step.setRollbackCount(v.getRollbackCount());
	step.setExitStatus(new ExitStatus(v.getExitCode()));
	step.setLastUpdated(v.getLastUpdated());
	step.setVersion(v.getVersion());
	step.setStatus(v.getStatus());
	step.setExecutionContext(v.getExecutionContext());
	return step;
}
 
開發者ID:marklogic-community,項目名稱:marklogic-spring-batch,代碼行數:24,代碼來源:StepExecutionAdapter.java

示例2: marshallStepExecutionTest

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
@Test
public void marshallStepExecutionTest() throws Exception {
    JobInstance jobInstance = new JobInstance(1234L, "test");
    JobExecution jobExecution = new JobExecution(123L);
    jobExecution.setJobInstance(jobInstance);
    StepExecution step = new StepExecution("testStep", jobExecution);
    step.setLastUpdated(new Date(System.currentTimeMillis()));
    StepExecutionAdapter adapter = new StepExecutionAdapter();
    AdaptedStepExecution adStep = adapter.marshal(step);
    jaxb2Marshaller.marshal(adStep, result);
    Fragment frag = new Fragment(new DOMBuilder().build(doc));
    frag.setNamespaces(getNamespaceProvider().getNamespaces());
    frag.prettyPrint();
    frag.assertElementExists("/msb:stepExecution");
    frag.assertElementExists("/msb:stepExecution/msb:lastUpdated");
    frag.assertElementValue("/msb:stepExecution/msb:stepName", "testStep");
}
 
開發者ID:marklogic-community,項目名稱:marklogic-spring-batch,代碼行數:18,代碼來源:MarshallSpringBatchPojoToXmlTest.java

示例3: unmarshal

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
@Override
public JobExecution unmarshal(AdaptedJobExecution v) throws Exception {
	JobExecution jobExec = new JobExecution(v.getId(), v.getJobParameters());
	jobExec.setJobInstance(v.getJobInstance());
	jobExec.setCreateTime(v.getCreateDateTime());
	jobExec.setEndTime(v.getEndDateTime());
	jobExec.setLastUpdated(v.getLastUpdatedDateTime());
	jobExec.setStartTime(v.getStartDateTime());
	jobExec.setStatus(BatchStatus.valueOf(v.getStatus()));
	jobExec.setExitStatus(new ExitStatus(v.getExitCode(), ""));
	jobExec.addStepExecutions(v.getStepExecutions());
	jobExec.setVersion(v.getVersion());
	jobExec.setExecutionContext(v.getExecutionContext());
	return jobExec;
}
 
開發者ID:marklogic-community,項目名稱:marklogic-spring-batch,代碼行數:16,代碼來源:JobExecutionAdapter.java

示例4: createMasterStepExecution

import org.springframework.batch.core.JobExecution; //導入方法依賴的package包/類
private StepExecution createMasterStepExecution() {

		JobExecution jobExecution = new JobExecution(1L);
		jobExecution.setJobInstance(new JobInstance(2L, "partitionedJob"));

		StepExecution masterStepExecution = new StepExecution("masterStep", jobExecution);
		masterStepExecution.setId(3L);

		return masterStepExecution;
	}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-task,代碼行數:11,代碼來源:DeployerPartitionHandlerTests.java


注:本文中的org.springframework.batch.core.JobExecution.setJobInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。