protected void registerStepListenerAsChunkListener() { for (StepExecutionListener stepExecutionListener: properties.getStepExecutionListeners()){ if (stepExecutionListener instanceof ChunkListener){ listener((ChunkListener)stepExecutionListener); } } }
/** * Registers objects using the annotation based listener configuration. * * @param listener the object that has a method configured with listener annotation * @return this for fluent chaining */ @SuppressWarnings("unchecked") @Override public SimpleStepBuilder<I, O> listener(Object listener) { super.listener(listener); Set<Method> itemListenerMethods = new HashSet<>(); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeRead.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterRead.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeProcess.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterProcess.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeWrite.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterWrite.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnReadError.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnProcessError.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnWriteError.class)); if(itemListenerMethods.size() > 0) { StepListenerFactoryBean factory = new StepListenerFactoryBean(); factory.setDelegate(listener); itemListeners.add((StepListener) factory.getObject()); } @SuppressWarnings("unchecked") SimpleStepBuilder<I, O> result = this; return result; }
/** * Registers objects using the annotation based listener configuration. * * @param listener the object that has a method configured with listener annotation * @return this for fluent chaining */ @Override public B listener(Object listener) { super.listener(listener); Set<Method> chunkListenerMethods = new HashSet<>(); chunkListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeChunk.class)); chunkListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterChunk.class)); chunkListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterChunkError.class)); if(chunkListenerMethods.size() > 0) { StepListenerFactoryBean factory = new StepListenerFactoryBean(); factory.setDelegate(listener); this.listener((ChunkListener) factory.getObject()); } @SuppressWarnings("unchecked") B result = (B) this; return result; }
builder.listener(listener);
protected void registerStepListenerAsChunkListener() { for (StepExecutionListener stepExecutionListener: properties.getStepExecutionListeners()){ if (stepExecutionListener instanceof ChunkListener){ listener((ChunkListener)stepExecutionListener); } } }
protected void registerStepListenerAsChunkListener() { for (StepExecutionListener stepExecutionListener: properties.getStepExecutionListeners()){ if (stepExecutionListener instanceof ChunkListener){ listener((ChunkListener)stepExecutionListener); } } }
protected void registerStepListenerAsChunkListener() { for (StepExecutionListener stepExecutionListener: properties.getStepExecutionListeners()){ if (stepExecutionListener instanceof ChunkListener){ listener((ChunkListener)stepExecutionListener); } } }
/** * Registers objects using the annotation based listener configuration. * * @param listener the object that has a method configured with listener annotation * @return this for fluent chaining */ @SuppressWarnings("unchecked") @Override public SimpleStepBuilder<I, O> listener(Object listener) { super.listener(listener); Set<Method> itemListenerMethods = new HashSet<>(); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeRead.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterRead.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeProcess.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterProcess.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeWrite.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterWrite.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnReadError.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnProcessError.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnWriteError.class)); if(itemListenerMethods.size() > 0) { StepListenerFactoryBean factory = new StepListenerFactoryBean(); factory.setDelegate(listener); itemListeners.add((StepListener) factory.getObject()); } @SuppressWarnings("unchecked") SimpleStepBuilder<I, O> result = this; return result; }
/** * Registers objects using the annotation based listener configuration. * * @param listener the object that has a method configured with listener annotation * @return this for fluent chaining */ @SuppressWarnings("unchecked") @Override public SimpleStepBuilder<I, O> listener(Object listener) { super.listener(listener); Set<Method> itemListenerMethods = new HashSet<>(); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeRead.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterRead.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeProcess.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterProcess.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeWrite.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterWrite.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnReadError.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnProcessError.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnWriteError.class)); if(itemListenerMethods.size() > 0) { StepListenerFactoryBean factory = new StepListenerFactoryBean(); factory.setDelegate(listener); itemListeners.add((StepListener) factory.getObject()); } @SuppressWarnings("unchecked") SimpleStepBuilder<I, O> result = this; return result; }
/** * Registers objects using the annotation based listener configuration. * * @param listener the object that has a method configured with listener annotation * @return this for fluent chaining */ @Override public B listener(Object listener) { super.listener(listener); Set<Method> chunkListenerMethods = new HashSet<>(); chunkListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeChunk.class)); chunkListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterChunk.class)); chunkListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterChunkError.class)); if(chunkListenerMethods.size() > 0) { StepListenerFactoryBean factory = new StepListenerFactoryBean(); factory.setDelegate(listener); this.listener((ChunkListener) factory.getObject()); } @SuppressWarnings("unchecked") B result = (B) this; return result; }
/** * Registers objects using the annotation based listener configuration. * * @param listener the object that has a method configured with listener annotation * @return this for fluent chaining */ @Override public B listener(Object listener) { super.listener(listener); Set<Method> chunkListenerMethods = new HashSet<>(); chunkListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeChunk.class)); chunkListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterChunk.class)); chunkListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterChunkError.class)); if(chunkListenerMethods.size() > 0) { StepListenerFactoryBean factory = new StepListenerFactoryBean(); factory.setDelegate(listener); this.listener((ChunkListener) factory.getObject()); } @SuppressWarnings("unchecked") B result = (B) this; return result; }
/** * Registers objects using the annotation based listener configuration. * * @param listener the object that has a method configured with listener annotation * @return this for fluent chaining */ @Override public SimpleStepBuilder listener(Object listener) { super.listener(listener); Set<Method> itemListenerMethods = new HashSet<Method>(); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeRead.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterRead.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeProcess.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterProcess.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeWrite.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterWrite.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnReadError.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnProcessError.class)); itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnWriteError.class)); if(itemListenerMethods.size() > 0) { StepListenerFactoryBean factory = new StepListenerFactoryBean(); factory.setDelegate(listener); itemListeners.add((StepListener) factory.getObject()); } @SuppressWarnings("unchecked") SimpleStepBuilder result = this; return result; }
@Override public Step getObject() throws Exception { TaskLauncherTasklet taskLauncherTasklet = new TaskLauncherTasklet( this.taskOperations, taskConfigurer.getTaskExplorer(), this.composedTaskProperties, this.taskName); taskLauncherTasklet.setArguments(this.arguments); taskLauncherTasklet.setProperties(this.taskSpecificProps); String stepName = this.taskName; return this.steps.get(stepName) .tasklet(taskLauncherTasklet) .transactionAttribute(getTransactionAttribute()) .listener(this.composedTaskStepExecutionListener) .build(); }
builder.listener(listener);
builder.listener(listener);
builder.listener(listener);