本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例6: CheckpointAlgorithmProxy
import javax.batch.api.chunk.CheckpointAlgorithm; //导入依赖的package包/类
CheckpointAlgorithmProxy(final CheckpointAlgorithm delegate) {
super(delegate);
}
示例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();
}
示例8: CheckpointAlgorithmProxy
import javax.batch.api.chunk.CheckpointAlgorithm; //导入依赖的package包/类
public CheckpointAlgorithmProxy(final CheckpointAlgorithm delegate) {
super(delegate);
}