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


Java CheckpointAlgorithm類代碼示例

本文整理匯總了Java中javax.batch.api.chunk.CheckpointAlgorithm的典型用法代碼示例。如果您正苦於以下問題:Java CheckpointAlgorithm類的具體用法?Java CheckpointAlgorithm怎麽用?Java CheckpointAlgorithm使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: CheckpointManager

import javax.batch.api.chunk.CheckpointAlgorithm; //導入依賴的package包/類
public CheckpointManager(ItemReaderProxy reader, ItemWriterProxy writer,CheckpointAlgorithm chkptAlg,
		long executionId, long jobInstanceID, String  stepId) {
	this.readerProxy = reader;
	this.writerProxy = writer;
	this.checkpointAlgorithm = chkptAlg;
	this.executionId = executionId;
	this.stepId = stepId;
	this.jobInstanceID = jobInstanceID;
	
	_persistenceManagerService = servicesManager.getPersistenceManagerService();
}
 
開發者ID:WASdev,項目名稱:standards.jsr352.jbatch,代碼行數:12,代碼來源:CheckpointManager.java

示例2: createCheckpointAlgorithmProxy

import javax.batch.api.chunk.CheckpointAlgorithm; //導入依賴的package包/類
public static CheckpointAlgorithmProxy createCheckpointAlgorithmProxy(String id, InjectionReferences injectionRefs, StepContextImpl stepContext) throws ArtifactValidationException {
    CheckpointAlgorithm loadedArtifact = (CheckpointAlgorithm)loadArtifact(id, injectionRefs);
    CheckpointAlgorithmProxy proxy = new CheckpointAlgorithmProxy(loadedArtifact);
    proxy.setStepContext(stepContext);
    
    return proxy;
}
 
開發者ID:WASdev,項目名稱:standards.jsr352.jbatch,代碼行數:8,代碼來源:ProxyFactory.java

示例3: createCheckpointAlgorithmProxy

import javax.batch.api.chunk.CheckpointAlgorithm; //導入依賴的package包/類
public static CheckpointAlgorithmProxy createCheckpointAlgorithmProxy(final BatchArtifactFactory factory, final String id, final InjectionReferences injectionRefs,
                                                                      final RuntimeJobExecution execution) {
    final CheckpointAlgorithm loadedArtifact = (CheckpointAlgorithm) loadArtifact(factory, id, injectionRefs, execution);
    final CheckpointAlgorithmProxy proxy = new CheckpointAlgorithmProxy(loadedArtifact);
    proxy.setStepContext(injectionRefs.getStepContext());
    return proxy;
}
 
開發者ID:apache,項目名稱:incubator-batchee,代碼行數:8,代碼來源:ProxyFactory.java

示例4: CheckpointManager

import javax.batch.api.chunk.CheckpointAlgorithm; //導入依賴的package包/類
public CheckpointManager(final ItemReader reader, final ItemWriter writer,
                         final CheckpointAlgorithm chkptAlg,
                         final long jobInstanceID, final String stepId,
                         final PersistenceManagerService persistenceManagerService,
                         final DataRepresentationService dataRepresentationService) {
    this.readerProxy = reader;
    this.writerProxy = writer;
    this.checkpointAlgorithm = chkptAlg;
    this.stepId = stepId;
    this.jobInstanceID = jobInstanceID;

    this.persistenceManagerService = persistenceManagerService;
    this.dataRepresentationService = dataRepresentationService;
}
 
開發者ID:apache,項目名稱:incubator-batchee,代碼行數:15,代碼來源:CheckpointManager.java

示例5: initializeCheckpointManager

import javax.batch.api.chunk.CheckpointAlgorithm; //導入依賴的package包/類
private void initializeCheckpointManager() {
    CheckpointAlgorithm checkpointAlgorithm = null;

    checkpointAtThisItemCount = ChunkHelper.getItemCount(chunk);
    int timeLimitSeconds = ChunkHelper.getTimeLimit(chunk);
    customCheckpointPolicy = ChunkHelper.isCustomCheckpointPolicy(chunk);  // Supplies default if needed

    if (!customCheckpointPolicy) {
        ItemCheckpointAlgorithm ica = new ItemCheckpointAlgorithm();
        ica.setItemCount(checkpointAtThisItemCount);
        ica.setTimeLimitSeconds(timeLimitSeconds);
        checkpointAlgorithm = ica;

    } else {
        final List<Property> propList;

        if (chunk.getCheckpointAlgorithm() == null) {
            throw new IllegalArgumentException("Configured checkpoint-policy of 'custom' but without a corresponding <checkpoint-algorithm> element.");
        } else {
            propList = (chunk.getCheckpointAlgorithm().getProperties() == null) ? null : chunk.getCheckpointAlgorithm().getProperties().getPropertyList();
        }

        InjectionReferences injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList);
        checkpointAlgorithm = ProxyFactory.createCheckpointAlgorithmProxy(artifactFactory, chunk.getCheckpointAlgorithm().getRef(), injectionRef, jobExecutionImpl);
    }

    // Finally, for both policies now
    checkpointManager = new CheckpointManager(readerProxy, writerProxy, checkpointAlgorithm,
            jobExecutionImpl.getJobInstance().getInstanceId(), step.getId(), persistenceManagerService, dataRepresentationService);

    // A related piece of data we'll calculate here is the tran timeout.   Though we won't include
    // it in the checkpoint manager since we'll set it directly on the tran mgr before each chunk.
    stepPropertyTranTimeoutSeconds = initStepTransactionTimeout();
}
 
開發者ID:apache,項目名稱:incubator-batchee,代碼行數:35,代碼來源:ChunkStepController.java

示例6: CheckpointAlgorithmProxy

import javax.batch.api.chunk.CheckpointAlgorithm; //導入依賴的package包/類
CheckpointAlgorithmProxy(final CheckpointAlgorithm delegate) {
    super(delegate);
}
 
開發者ID:WASdev,項目名稱:standards.jsr352.jbatch,代碼行數:4,代碼來源:CheckpointAlgorithmProxy.java

示例7: initializeCheckpointManager

import javax.batch.api.chunk.CheckpointAlgorithm; //導入依賴的package包/類
private void initializeCheckpointManager() {
	
	CheckpointAlgorithm checkpointAlgorithm = null;

	checkpointAtThisItemCount = ChunkHelper.getItemCount(chunk);
	int timeLimitSeconds = ChunkHelper.getTimeLimit(chunk);
	customCheckpointPolicy = ChunkHelper.isCustomCheckpointPolicy(chunk);  // Supplies default if needed

	if (!customCheckpointPolicy) {

		ItemCheckpointAlgorithm ica = new ItemCheckpointAlgorithm();
		ica.setItemCount(checkpointAtThisItemCount);
		ica.setTimeLimitSeconds(timeLimitSeconds);
		logger.fine("Initialize checkpoint manager with item-count=" + checkpointAtThisItemCount + 
				", and time limit = " + timeLimitSeconds + " seconds.");
		checkpointAlgorithm = ica;

	} else { 

		if (chunk.getCheckpointAlgorithm() == null) {
			throw new IllegalArgumentException("Configured checkpoint-policy of 'custom' but without a corresponding <checkpoint-algorithm> element.");
		}
		
		try {
			List<Property> propList = (chunk.getCheckpointAlgorithm().getProperties() == null) ? null : chunk.getCheckpointAlgorithm().getProperties().getPropertyList();

			InjectionReferences injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList);

			checkpointAlgorithm = ProxyFactory.createCheckpointAlgorithmProxy(chunk.getCheckpointAlgorithm().getRef(), injectionRef, stepContext);

			if (logger.isLoggable(Level.FINE)) {
				logger.fine("Created CheckpointAlgorithmProxy for custom checkpoint algorithm [" + checkpointAlgorithm + "]");
			}
				
		} catch (ArtifactValidationException e) {
			throw new BatchContainerServiceException("Cannot create the CheckpointAlgorithm for policy [" + chunk.getCheckpointPolicy()
					+ "]", e);
		}

	}	
	
	// Finally, for both policies now
	checkpointManager = new CheckpointManager(readerProxy, writerProxy, checkpointAlgorithm, jobExecutionImpl.getExecutionId(), jobExecutionImpl
				.getJobInstance().getInstanceId(), step.getId());
	
	// A related piece of data we'll calculate here is the tran timeout.   Though we won't include
	// it in the checkpoint manager since we'll set it directly on the tran mgr before each chunk.
	stepPropertyTranTimeoutSeconds = initStepTransactionTimeout();
}
 
開發者ID:WASdev,項目名稱:standards.jsr352.jbatch,代碼行數:50,代碼來源:ChunkStepControllerImpl.java

示例8: CheckpointAlgorithmProxy

import javax.batch.api.chunk.CheckpointAlgorithm; //導入依賴的package包/類
public CheckpointAlgorithmProxy(final CheckpointAlgorithm delegate) {
    super(delegate);
}
 
開發者ID:apache,項目名稱:incubator-batchee,代碼行數:4,代碼來源:CheckpointAlgorithmProxy.java


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