private void setupListeners() { JSLJob jobModel = jobExecution.getJobNavigator().getRootModelElement(); InjectionReferences injectionRef = new InjectionReferences(jobContext, null, null); listenerFactory = new ListenerFactory(jobModel, injectionRef); jobExecution.setListenerFactory(listenerFactory); }
private void setupListeners() { JSLJob jobModel = jobExecution.getJobNavigator().getRootModelElement(); InjectionReferences injectionRef = new InjectionReferences(jobContext, null, null); listenerFactory = new ListenerFactory(jobModel, injectionRef); jobExecution.setListenerFactory(listenerFactory); }
private void setupListeners() { JSLJob jobModel = runtimeWorkUnitExecution.getJobNavigator().getRootModelElement(); InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), null, null); listenerFactory = new ListenerFactory(jobModel, injectionRef); runtimeWorkUnitExecution.setListenerFactory(listenerFactory); }
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); } }
InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, propList);
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); } }
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); } } } }
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); } } } }
@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); }
@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); } } } }
@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); } } }
@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); } } }
@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); } } }
List<Property> propList = (chunk.getCheckpointAlgorithm().getProperties() == null) ? null : chunk.getCheckpointAlgorithm().getProperties().getPropertyList(); InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, propList);
List<Property> propList = (chunk.getCheckpointAlgorithm().getProperties() == null) ? null : chunk.getCheckpointAlgorithm().getProperties().getPropertyList(); InjectionReferences injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList);
List<Property> itemReaderProps = itemReader.getProperties() == null ? null : itemReader.getProperties().getPropertyList(); try { InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, itemReaderProps); try { InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, itemProcessorProps); List<Property> itemWriterProps = itemWriter.getProperties() == null ? null : itemWriter.getProperties().getPropertyList(); try { InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, itemWriterProps); InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, null);
InjectionReferences injectionRef = new InjectionReferences(jobExecution.getWorkUnitJobContext(), null, propList);
properties.add(ibmBatch); properties.add(privateSuper); mockInjectionRefs = new InjectionReferences(jobCtx, runtimeStepCtx, properties); mockery.checking(new Expectations() {
InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, propertyList);