当前位置: 首页>>代码示例>>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;未经允许,请勿转载。