/// <summary> /// Calls the registered listeners in reverse order, respecting and /// prioritizing those that hold an order metadata information. /// </summary> /// <param name="stepExecution"></param> /// <returns></returns> public ExitStatus AfterStep(StepExecution stepExecution) { if (Logger.IsTraceEnabled) { Logger.Trace("CompositeStepExecutionListener :: Entering AfterStep"); } IEnumerator <IStepExecutionListener> enumerator = _list.Reverse(); while (enumerator.MoveNext()) { if (Logger.IsTraceEnabled) { Logger.Trace("CompositeStepExecutionListener :: Before Executing AfterStep - stepExecution.ExitStatus ={0}", stepExecution.ExitStatus); } IStepExecutionListener listener = enumerator.Current; ExitStatus close = listener.AfterStep(stepExecution); stepExecution.ExitStatus = stepExecution.ExitStatus.And(close); if (Logger.IsTraceEnabled) { Logger.Trace("CompositeStepExecutionListener :: After Executing AfterStep - stepExecution.ExitStatus ={0}", stepExecution.ExitStatus); } } if (Logger.IsTraceEnabled) { Logger.Trace("CompositeStepExecutionListener :: Exiting AfterStep"); } return(stepExecution.ExitStatus); }
/// <summary> /// Registers an additional listener. /// </summary> /// <param name="stepExecutionListener"></param> public void Register(IStepExecutionListener stepExecutionListener) { _list.Add(stepExecutionListener); if (Logger.IsTraceEnabled) { Logger.Trace("CompositeStepExecutionListener : registering new stepExecutionListener of type [{0}]", stepExecutionListener.GetType().FullName ); } }
/// <summary> /// Calls the registered listeners in order, respecting and prioritizing those /// that hold an order metadata information. /// </summary> /// <param name="stepExecution"></param> public void BeforeStep(StepExecution stepExecution) { IEnumerator <IStepExecutionListener> enumerator = _list.Reverse(); while (enumerator.MoveNext()) { IStepExecutionListener listener = enumerator.Current; listener.BeforeStep(stepExecution); } }
/// <summary> /// Registers an additional listener. /// </summary> /// <param name="stepExecutionListener"></param> public void Register(IStepExecutionListener stepExecutionListener) { _list.Add(stepExecutionListener); if (Logger.IsTraceEnabled) { Logger.Trace("CompositeStepExecutionListener : registering new stepExecutionListener of type [{0}]", stepExecutionListener.GetType().FullName ); } }
/// <summary> /// Public setter for the listeners. /// </summary> /// <param name="listeners"></param> public void SetListeners(IStepExecutionListener[] listeners) { _list.SetItems(listeners.ToList()); if (Logger.IsTraceEnabled) { Logger.Trace("CompositeStepExecutionListener : registering new list of stepExecutionListener of size [{0}]", listeners.Length ); } }
/// <summary> /// Registers an array of step execution listeners. /// </summary> /// <param name="listeners"></param> public void SetStepExecutionListeners(IStepExecutionListener[] listeners) { foreach (IStepExecutionListener listener in listeners) { RegisterStepExecutionListener(listener); } }
/// <summary> /// Registers step execution listener. /// </summary> /// <param name="listener"></param> public void RegisterStepExecutionListener(IStepExecutionListener listener) { _stepExecutionListener.Register(listener); }
/// <summary> /// Registers step execution listener. /// </summary> /// <param name="listener"></param> public void RegisterStepExecutionListener(IStepExecutionListener listener) { _stepExecutionListener.Register(listener); }