public List<ChunkListenerProxy> getChunkListeners(Step step, InjectionReferences injectionRefs, RuntimeStepExecution stepContext) { List<ListenerInfo> stepListenerInfo = getStepListenerInfo(step, injectionRefs); List<ChunkListenerProxy> retVal = new ArrayList<ChunkListenerProxy>(); for (ListenerInfo li : stepListenerInfo) { if (li.isChunkListener()) { ChunkListenerProxy proxy = new ChunkListenerProxy((ChunkListener) li.getArtifact()); proxy.setStepContext(stepContext); retVal.add(proxy); } } return retVal; }
private void callChunkListenerOnError(Exception e) { logger.fine("Caught exception in chunk processing. Attempting to call onError() for chunk listeners."); for (ChunkListenerProxy chunkProxy : chunkListeners) { try { chunkProxy.onError(e); // 2. Catch throwable, not exception } catch (Throwable t) { // Fail-fast and abort. throw new BatchContainerRuntimeException("Caught secondary throwable when calling chunk listener onError().", t); } } }
chunkProxy.beforeChunk(); chunkProxy.afterChunk(); chunkProxy.onError(e); } catch (Exception e1) { StringWriter sw = new StringWriter();
chunkProxy.beforeChunk(); chunkProxy.afterChunk();
chunkProxy.beforeChunk(); chunkProxy.afterChunk();
public List<ChunkListenerProxy> getChunkListeners(Step step, InjectionReferences injectionRefs, StepContextImpl stepContext) { List<ListenerInfo> stepListenerInfo = getStepListenerInfo(step, injectionRefs); List<ChunkListenerProxy> retVal = new ArrayList<ChunkListenerProxy>(); for (ListenerInfo li : stepListenerInfo) { if (li.isChunkListener()) { ChunkListenerProxy proxy = new ChunkListenerProxy((ChunkListener) li.getArtifact()); proxy.setStepContext(stepContext); retVal.add(proxy); } } return retVal; }
private void callChunkListenerOnError(Exception e) { logger.fine("Caught exception in chunk processing. Attempting to call onError() for chunk listeners."); for (ChunkListenerProxy chunkProxy : chunkListeners) { try { chunkProxy.onError(e); // 2. Catch throwable, not exception } catch (Throwable t) { // Fail-fast and abort. throw new BatchContainerRuntimeException("Caught secondary throwable when calling chunk listener onError().", t); } } }
public List<ChunkListenerProxy> getChunkListeners(Step step, InjectionReferences injectionRefs, StepContextImpl stepContext) { List<ListenerInfo> stepListenerInfo = getStepListenerInfo(step, injectionRefs); List<ChunkListenerProxy> retVal = new ArrayList<ChunkListenerProxy>(); for (ListenerInfo li : stepListenerInfo) { if (li.isChunkListener()) { ChunkListenerProxy proxy = new ChunkListenerProxy((ChunkListener) li.getArtifact()); proxy.setStepContext(stepContext); retVal.add(proxy); } } return retVal; }