/** * 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 */ public B listener(Object listener) { Set<Method> stepExecutionListenerMethods = new HashSet<>(); stepExecutionListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeStep.class)); stepExecutionListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterStep.class)); if(stepExecutionListenerMethods.size() > 0) { StepListenerFactoryBean factory = new StepListenerFactoryBean(); factory.setDelegate(listener); properties.addStepExecutionListener((StepExecutionListener) factory.getObject()); } @SuppressWarnings("unchecked") B result = (B) this; return result; }
protected void enhance(Step target) { if (target instanceof AbstractStep) { AbstractStep step = (AbstractStep) target; step.setJobRepository(properties.getJobRepository()); Boolean allowStartIfComplete = properties.allowStartIfComplete; if (allowStartIfComplete != null) { step.setAllowStartIfComplete(allowStartIfComplete); } step.setStartLimit(properties.startLimit); List<StepExecutionListener> listeners = properties.stepExecutionListeners; if (!listeners.isEmpty()) { step.setStepExecutionListeners(listeners.toArray(new StepExecutionListener[0])); } } if (target instanceof TaskletStep) { TaskletStep step = (TaskletStep) target; step.setTransactionManager(properties.transactionManager); } }
/** * 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 */ public B listener(Object listener) { Set<Method> stepExecutionListenerMethods = new HashSet<Method>(); stepExecutionListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeStep.class)); stepExecutionListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterStep.class)); if(stepExecutionListenerMethods.size() > 0) { StepListenerFactoryBean factory = new StepListenerFactoryBean(); factory.setDelegate(listener); properties.addStepExecutionListener((StepExecutionListener) factory.getObject()); } @SuppressWarnings("unchecked") B result = (B) this; return result; }
protected void enhance(Step target) { if (target instanceof AbstractStep) { AbstractStep step = (AbstractStep) target; step.setJobRepository(properties.getJobRepository()); Boolean allowStartIfComplete = properties.allowStartIfComplete; if (allowStartIfComplete != null) { step.setAllowStartIfComplete(allowStartIfComplete); } step.setStartLimit(properties.startLimit); List<StepExecutionListener> listeners = properties.stepExecutionListeners; if (!listeners.isEmpty()) { step.setStepExecutionListeners(listeners.toArray(new StepExecutionListener[0])); } } if (target instanceof TaskletStep) { TaskletStep step = (TaskletStep) target; step.setTransactionManager(properties.transactionManager); } }
/** * 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 */ public B listener(Object listener) { Set<Method> stepExecutionListenerMethods = new HashSet<Method>(); stepExecutionListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeStep.class)); stepExecutionListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterStep.class)); if(stepExecutionListenerMethods.size() > 0) { StepListenerFactoryBean factory = new StepListenerFactoryBean(); factory.setDelegate(listener); properties.addStepExecutionListener((StepExecutionListener) factory.getObject()); } @SuppressWarnings("unchecked") B result = (B) this; return result; }
protected void enhance(Step target) { if (target instanceof AbstractStep) { AbstractStep step = (AbstractStep) target; step.setJobRepository(properties.getJobRepository()); Boolean allowStartIfComplete = properties.allowStartIfComplete; if (allowStartIfComplete != null) { step.setAllowStartIfComplete(allowStartIfComplete); } step.setStartLimit(properties.startLimit); List<StepExecutionListener> listeners = properties.stepExecutionListeners; if (!listeners.isEmpty()) { step.setStepExecutionListeners(listeners.toArray(new StepExecutionListener[0])); } } if (target instanceof TaskletStep) { TaskletStep step = (TaskletStep) target; step.setTransactionManager(properties.transactionManager); } }
protected void enhance(Step target) { if (target instanceof AbstractStep) { AbstractStep step = (AbstractStep) target; step.setJobRepository(properties.getJobRepository()); Boolean allowStartIfComplete = properties.allowStartIfComplete; if (allowStartIfComplete != null) { step.setAllowStartIfComplete(allowStartIfComplete); } step.setStartLimit(properties.startLimit); List<StepExecutionListener> listeners = properties.stepExecutionListeners; if (!listeners.isEmpty()) { step.setStepExecutionListeners(listeners.toArray(new StepExecutionListener[0])); } } if (target instanceof TaskletStep) { TaskletStep step = (TaskletStep) target; step.setTransactionManager(properties.transactionManager); } }
/** * 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 */ public B listener(Object listener) { Set<Method> stepExecutionListenerMethods = new HashSet<Method>(); stepExecutionListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), BeforeStep.class)); stepExecutionListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterStep.class)); if(stepExecutionListenerMethods.size() > 0) { StepListenerFactoryBean factory = new StepListenerFactoryBean(); factory.setDelegate(listener); properties.addStepExecutionListener((StepExecutionListener) factory.getObject()); } @SuppressWarnings("unchecked") B result = (B) this; return result; }
public StepBuilderHelper(String name) { this.properties = new CommonStepProperties(); properties.name = name; }
@SuppressWarnings("unchecked") protected void registerStepListenerAsSkipListener() { for (StepExecutionListener stepExecutionListener: properties.getStepExecutionListeners()){ if (stepExecutionListener instanceof SkipListener){ listener((SkipListener<I,O>)stepExecutionListener); } } for (ChunkListener chunkListener: this.chunkListeners){ if (chunkListener instanceof SkipListener){ listener((SkipListener<I,O>)chunkListener); } } }
@SuppressWarnings("unchecked") protected void registerStepListenerAsSkipListener() { for (StepExecutionListener stepExecutionListener: properties.getStepExecutionListeners()){ if (stepExecutionListener instanceof SkipListener){ listener((SkipListener<I,O>)stepExecutionListener); } } for (ChunkListener chunkListener: this.chunkListeners){ if (chunkListener instanceof SkipListener){ listener((SkipListener<I,O>)chunkListener); } } }
public StepBuilderHelper(String name) { this.properties = new CommonStepProperties(); properties.name = name; }
protected void registerStepListenerAsItemListener() { for (StepExecutionListener stepExecutionListener: properties.getStepExecutionListeners()){ checkAndAddItemListener(stepExecutionListener); } for (ChunkListener chunkListener: this.chunkListeners){ checkAndAddItemListener(chunkListener); } }
protected void registerStepListenerAsItemListener() { for (StepExecutionListener stepExecutionListener: properties.getStepExecutionListeners()){ checkAndAddItemListener(stepExecutionListener); } for (ChunkListener chunkListener: this.chunkListeners){ checkAndAddItemListener(chunkListener); } }
protected void registerStepListenerAsItemListener() { for (StepExecutionListener stepExecutionListener: properties.getStepExecutionListeners()){ checkAndAddItemListener(stepExecutionListener); } for (ChunkListener chunkListener: this.chunkListeners){ checkAndAddItemListener(chunkListener); } }
public B listener(StepExecutionListener listener) { properties.addStepExecutionListener(listener); @SuppressWarnings("unchecked") B result = (B) this; return result; }
public B listener(StepExecutionListener listener) { properties.addStepExecutionListener(listener); @SuppressWarnings("unchecked") B result = (B) this; return result; }
protected void registerStepListenerAsChunkListener() { for (StepExecutionListener stepExecutionListener: properties.getStepExecutionListeners()){ if (stepExecutionListener instanceof ChunkListener){ listener((ChunkListener)stepExecutionListener); } } }
/** * Create a new builder initialized with any properties in the parent. The parent is copied, so it can be re-used. * * @param parent a parent helper containing common step properties */ protected StepBuilderHelper(StepBuilderHelper<?> parent) { this.properties = new CommonStepProperties(parent.properties); }
public StepBuilderHelper(String name) { this.properties = new CommonStepProperties(); properties.name = name; }