/// <summary> /// Registers a step execution with the current job execution. /// </summary> /// <param name="stepName"></param> /// <returns>the name of the step the new execution is associated with</returns> public StepExecution CreateStepExecution(string stepName) { StepExecution stepExecution = new StepExecution(stepName, this); if (!_stepExecutions.Contains(stepExecution)) { _stepExecutions.TryAdd(stepExecution); } return(stepExecution); }
/// <summary> /// Adds exception to failure exceptions collection. /// </summary> /// <param name="exception"></param> public void AddFailureException(Exception exception) { if (!_failureExceptions.Contains(exception)) { _failureExceptions.TryAdd(exception); } }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing && _observer != null && _observers != null && _observers.Contains(_observer)) { IBrokerObserver removing; if (_observers.TryTake(out removing)) { _logger.Debug($"Removed Observer: {ToString()}"); } else { _logger.Error($"Failed to remove Observer: {ToString()}"); } } disposedValue = true; } }