private void invokeBatchlet(Batchlet batchlet) throws BatchContainerServiceException { String batchletId = batchlet.getRef(); List<Property> propList = (batchlet.getProperties() == null) ? null : batchlet.getProperties().getPropertyList(); String sourceMethod = "invokeBatchlet"; if (logger.isLoggable(Level.FINER)) { logger.entering(sourceClass, sourceMethod, batchletId); } String exitStatus = null; InjectionReferences injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { batchletProxy = ProxyFactory.createBatchletProxy(batchletId, injectionRef, stepContext); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the batchlet [" + batchletId + "]", e); } if (logger.isLoggable(Level.FINE)) logger.fine("Batchlet is loaded and validated: " + batchletProxy); if (wasStopIssued()) { logger.fine("Exit without executing batchlet since stop() request has been received."); } else { logger.fine("Starting process() for the Batchlet Artifact"); String processRetVal = batchletProxy.process(); logger.fine("Set process() return value = " + processRetVal + " for possible use as exitStatus"); stepContext.setBatchletProcessRetVal(processRetVal); logger.exiting(sourceClass, sourceMethod, exitStatus==null ? "<null>" : exitStatus); } }
public static CheckpointAlgorithmProxy getCheckpointAlgorithmProxy (Step step, InjectionReferences injectionReferences, StepContextImpl stepContext) throws ArtifactValidationException{ Chunk chunk = step.getChunk(); CheckpointAlgorithmProxy proxy = null; String checkpointType = chunk.getCheckpointPolicy(); if (checkpointType.equals("item")) { proxy = new CheckpointAlgorithmProxy( new ItemCheckpointAlgorithm()); }else if (checkpointType.equalsIgnoreCase("custom")) { proxy = ProxyFactory.createCheckpointAlgorithmProxy(chunk .getCheckpointAlgorithm().getRef(), injectionReferences, stepContext); } return proxy; }
@Override public ExecutionStatus execute() { String deciderId = decision.getRef(); List<Property> propList = (decision.getProperties() == null) ? null : decision.getProperties().getPropertyList(); DeciderProxy deciderProxy; //Create a decider proxy and inject the associated properties /* Set the contexts associated with this scope */ //job context is always in scope //the parent controller will only pass one valid context to a decision controller //so two of these contexts will always be null InjectionReferences injectionRef = new InjectionReferences(jobExecution.getJobContext(), null, propList); try { deciderProxy = ProxyFactory.createDeciderProxy(deciderId,injectionRef ); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the decider [" + deciderId + "]", e); } String exitStatus = deciderProxy.decide(this.previousStepExecutions); logger.fine("Decider exiting and setting job-level exit status to " + exitStatus); //Set the value returned from the decider as the job context exit status. this.jobExecution.getJobContext().setExitStatus(exitStatus); return new ExecutionStatus(ExtendedBatchStatus.NORMAL_COMPLETION, exitStatus); }
InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, itemReaderProps); readerProxy = ProxyFactory.createItemReaderProxy(itemReader.getRef(), injectionRef, runtimeStepExecution); processorProxy = ProxyFactory.createItemProcessorProxy(itemProcessor.getRef(), injectionRef, runtimeStepExecution); if (logger.isLoggable(Level.FINE)) { logger.fine("Created ItemProcessorProxy for " + itemProcessor.getRef()); InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, itemWriterProps); writerProxy = ProxyFactory.createItemWriterProxy(itemWriter.getRef(), injectionRef, runtimeStepExecution); if (logger.isLoggable(Level.FINE)) { logger.fine("Created ItemWriterProxy for " + itemWriter.getRef());
@Override protected void setupStepArtifacts() { InjectionReferences injectionRef = null; injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, null); this.stepListeners = jobExecutionImpl.getListenerFactory().getStepListeners(step, injectionRef, stepContext); Analyzer analyzer = step.getPartition().getAnalyzer(); if (analyzer != null) { final List<Property> propList = analyzer.getProperties() == null ? null : analyzer.getProperties() .getPropertyList(); injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { analyzerProxy = ProxyFactory.createPartitionAnalyzerProxy(analyzer.getRef(), injectionRef, stepContext); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the analyzer [" + analyzer.getRef() + "]", e); } } PartitionReducer partitionReducer = step.getPartition().getReducer(); if (partitionReducer != null) { final List<Property> propList = partitionReducer.getProperties() == null ? null : partitionReducer.getProperties() .getPropertyList(); injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { this.partitionReducerProxy = ProxyFactory.createPartitionReducerProxy(partitionReducer.getRef(), injectionRef, stepContext); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the analyzer [" + partitionReducer.getRef() + "]", e); } } }
protected void setupStepArtifacts() { // set up listeners InjectionReferences injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, null); this.stepListeners = jobExecutionImpl.getListenerFactory().getStepListeners(step, injectionRef, stepContext); // set up collectors if we are running a partitioned step if (step.getPartition() != null) { Collector collector = step.getPartition().getCollector(); if (collector != null) { List<Property> propList = (collector.getProperties() == null) ? null : collector.getProperties().getPropertyList(); /** * Inject job flow, split, and step contexts into partition * artifacts like collectors and listeners some of these * contexts may be null */ injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { this.collectorProxy = ProxyFactory.createPartitionCollectorProxy(collector.getRef(), injectionRef, this.stepContext); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the collector [" + collector.getRef() + "]", e); } } } }
partitionMapperProxy = ProxyFactory.createPartitionMapperProxy( partitionMapper.getRef(), injectionRef, stepContext); } catch (final ArtifactValidationException e) {
itemReaderProps); readerProxy = ProxyFactory.createItemReaderProxy(itemReader.getRef(), injectionRef, stepContext); itemProcessorProps); processorProxy = ProxyFactory.createItemProcessorProxy(itemProcessor.getRef(), injectionRef, stepContext); if (logger.isLoggable(Level.FINE)) { logger.fine("Created ItemProcessorProxy for " + itemProcessor.getRef()); itemWriterProps); writerProxy = ProxyFactory.createItemWriterProxy(itemWriter.getRef(), injectionRef, stepContext); if (logger.isLoggable(Level.FINE)) { logger.fine("Created ItemWriterProxy for " + itemWriter.getRef());
@Override protected void setupStepArtifacts() { InjectionReferences injectionRef = null; injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, null); this.stepListeners = jobExecutionImpl.getListenerFactory().getStepListeners(step, injectionRef, stepContext); Analyzer analyzer = step.getPartition().getAnalyzer(); if (analyzer != null) { final List<Property> propList = analyzer.getProperties() == null ? null : analyzer.getProperties() .getPropertyList(); injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { analyzerProxy = ProxyFactory.createPartitionAnalyzerProxy(analyzer.getRef(), injectionRef, stepContext); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the analyzer [" + analyzer.getRef() + "]", e); } } PartitionReducer partitionReducer = step.getPartition().getReducer(); if (partitionReducer != null) { final List<Property> propList = partitionReducer.getProperties() == null ? null : partitionReducer.getProperties() .getPropertyList(); injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { this.partitionReducerProxy = ProxyFactory.createPartitionReducerProxy(partitionReducer.getRef(), injectionRef, stepContext); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the analyzer [" + partitionReducer.getRef() + "]", e); } } }
protected void setupStepArtifacts() { // set up listeners InjectionReferences injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, null); this.stepListeners = jobExecutionImpl.getListenerFactory().getStepListeners(step, injectionRef, stepContext); // set up collectors if we are running a partitioned step if (step.getPartition() != null) { Collector collector = step.getPartition().getCollector(); if (collector != null) { List<Property> propList = (collector.getProperties() == null) ? null : collector.getProperties().getPropertyList(); /** * Inject job flow, split, and step contexts into partition * artifacts like collectors and listeners some of these * contexts may be null */ injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { this.collectorProxy = ProxyFactory.createPartitionCollectorProxy(collector.getRef(), injectionRef, this.stepContext); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the collector [" + collector.getRef() + "]", e); } } } }
partitionMapperProxy = ProxyFactory.createPartitionMapperProxy( partitionMapper.getRef(), injectionRef, stepContext); } catch (final ArtifactValidationException e) {
itemReaderProps); readerProxy = ProxyFactory.createItemReaderProxy(itemReader.getRef(), injectionRef, stepContext); itemProcessorProps); processorProxy = ProxyFactory.createItemProcessorProxy(itemProcessor.getRef(), injectionRef, stepContext); if (logger.isLoggable(Level.FINE)) { logger.fine("Created ItemProcessorProxy for " + itemProcessor.getRef()); itemWriterProps); writerProxy = ProxyFactory.createItemWriterProxy(itemWriter.getRef(), injectionRef, stepContext); if (logger.isLoggable(Level.FINE)) { logger.fine("Created ItemWriterProxy for " + itemWriter.getRef());
@Override protected void setupStepArtifacts() { InjectionReferences injectionRef = null; injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, null); this.stepListeners = runtimeWorkUnitExecution.getListenerFactory().getStepListeners(getStep(), injectionRef, runtimeStepExecution); Analyzer analyzer = getStep().getPartition().getAnalyzer(); if (analyzer != null) { final List<Property> propList = analyzer.getProperties() == null ? null : analyzer.getProperties().getPropertyList(); injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, propList); try { analyzerProxy = ProxyFactory.createPartitionAnalyzerProxy(analyzer.getRef(), injectionRef, runtimeStepExecution); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the analyzer [" + analyzer.getRef() + "]", e); } } PartitionReducer partitionReducer = getStep().getPartition().getReducer(); if (partitionReducer != null) { final List<Property> propList = partitionReducer.getProperties() == null ? null : partitionReducer.getProperties().getPropertyList(); injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, propList); try { this.partitionReducerProxy = ProxyFactory.createPartitionReducerProxy(partitionReducer.getRef(), injectionRef, runtimeStepExecution); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the reducer [" + partitionReducer.getRef() + "]", e); } } }
checkpointAlgorithm = ProxyFactory.createCheckpointAlgorithmProxy(chunk.getCheckpointAlgorithm().getRef(), injectionRef, runtimeStepExecution);
@Override public ExecutionStatus execute() { String deciderId = decision.getRef(); List<Property> propList = (decision.getProperties() == null) ? null : decision.getProperties().getPropertyList(); DeciderProxy deciderProxy; //Create a decider proxy and inject the associated properties /* Set the contexts associated with this scope */ //job context is always in scope //the parent controller will only pass one valid context to a decision controller //so two of these contexts will always be null InjectionReferences injectionRef = new InjectionReferences(jobExecution.getJobContext(), null, propList); try { deciderProxy = ProxyFactory.createDeciderProxy(deciderId,injectionRef ); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the decider [" + deciderId + "]", e); } String exitStatus = deciderProxy.decide(this.previousStepExecutions); logger.fine("Decider exiting and setting job-level exit status to " + exitStatus); //Set the value returned from the decider as the job context exit status. this.jobExecution.getJobContext().setExitStatus(exitStatus); return new ExecutionStatus(ExtendedBatchStatus.NORMAL_COMPLETION, exitStatus); }
protected void setupStepArtifacts() { // set up listeners InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, null); this.stepListeners = runtimeWorkUnitExecution.getListenerFactory().getStepListeners(getStep(), injectionRef, runtimeStepExecution); // set up collectors if we are running a partitioned step if ( isPartitionedStep() ) { Collector collector = getStep().getPartition().getCollector(); if (collector != null) { List<Property> propList = (collector.getProperties() == null) ? null : collector.getProperties().getPropertyList(); /** * Inject job flow, split, and step contexts into partition * artifacts like collectors and listeners some of these * contexts may be null */ injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, propList); try { this.collectorProxy = ProxyFactory.createPartitionCollectorProxy(collector.getRef(), injectionRef, this.runtimeStepExecution); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the collector [" + collector.getRef() + "]", e); } } } }
private void invokeBatchlet(Batchlet batchlet) throws BatchContainerServiceException { String batchletId = batchlet.getRef(); List<Property> propList = (batchlet.getProperties() == null) ? null : batchlet.getProperties().getPropertyList(); String sourceMethod = "invokeBatchlet"; if (logger.isLoggable(Level.FINER)) { logger.entering(sourceClass, sourceMethod, batchletId); } String exitStatus = null; InjectionReferences injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { batchletProxy = ProxyFactory.createBatchletProxy(batchletId, injectionRef, stepContext); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the batchlet [" + batchletId + "]", e); } if (logger.isLoggable(Level.FINE)) logger.fine("Batchlet is loaded and validated: " + batchletProxy); if (wasStopIssued()) { logger.fine("Exit without executing batchlet since stop() request has been received."); } else { String processRetVal = batchletProxy.process(); logger.fine("Set process() return value = " + processRetVal + " for possible use as exitStatus"); stepContext.setBatchletProcessRetVal(processRetVal); logger.exiting(sourceClass, sourceMethod, exitStatus==null ? "<null>" : exitStatus); } }
partitionMapperProxy = ProxyFactory.createPartitionMapperProxy( partitionMapper.getRef(), injectionRef, runtimeStepExecution); } catch (final ArtifactValidationException e) {
checkpointAlgorithm = ProxyFactory.createCheckpointAlgorithmProxy(chunk.getCheckpointAlgorithm().getRef(), injectionRef, stepContext);
deciderProxy = ProxyFactory.createDeciderProxy(deciderId, injectionRef); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the decider [" + deciderId + "]", e);