public Dispatcher(IDependencyResolver dependencyResolver,
            IJobCoordinator jobCoordinator, IErrorHandlingPolicy errorHandlingPolicy,
            IMethodBinder methodBinder,
            IEventStream eventStream,
            IRecoverableAction recoverableAction,
            IStatusChanger statusChanger,
            IContinuationLiveness continuationLiveness,
            IExceptionFilterDispatcher exceptionFilterDispatcher,
            IJobRootValidator jobRootValidator)
        {
            if (jobCoordinator == null) throw new ArgumentNullException("jobCoordinator");
            if (dependencyResolver == null) throw new ArgumentNullException("dependencyResolver");
            if (errorHandlingPolicy == null) throw new ArgumentNullException("errorHandlingPolicy");
            if (methodBinder == null) throw new ArgumentNullException("methodBinder");
            if (eventStream == null) throw new ArgumentNullException("eventStream");
            if (recoverableAction == null) throw new ArgumentNullException("recoverableAction");
            if (statusChanger == null) throw new ArgumentNullException("statusChanger");
            if (continuationLiveness == null) throw new ArgumentNullException("continuationLiveness");
            if (exceptionFilterDispatcher == null) throw new ArgumentNullException("exceptionFilterDispatcher");
            if (jobRootValidator == null) throw new ArgumentNullException("jobRootValidator");

            _jobCoordinator = jobCoordinator;
            _dependencyResolver = dependencyResolver;
            _errorHandlingPolicy = errorHandlingPolicy;
            _methodBinder = methodBinder;
            _eventStream = eventStream;
            _recoverableAction = recoverableAction;
            _statusChanger = statusChanger;
            _continuationLiveness = continuationLiveness;
            _exceptionFilterDispatcher = exceptionFilterDispatcher;
            _jobRootValidator = jobRootValidator;
        }
        public RawEndpointErrorHandlingPolicy(string endpointName, string localAddress, IDispatchMessages dispatcher, IErrorHandlingPolicy policy)
        {
            this.localAddress = localAddress;
            this.dispatcher   = dispatcher;
            this.policy       = policy;

            staticFaultMetadata = new Dictionary <string, string>
            {
                { FaultsHeaderKeys.FailedQ, localAddress },
                { Headers.ProcessingMachine, RuntimeEnvironment.MachineName },
                { Headers.ProcessingEndpoint, endpointName },
            };
        }
 public AuditIngestion(
     Func <MessageContext, IDispatchMessages, Task> onMessage,
     Func <IDispatchMessages, Task> initialize,
     string inputEndpoint,
     RawEndpointFactory rawEndpointFactory,
     IErrorHandlingPolicy errorHandlingPolicy,
     Func <string, Exception, Task> onCriticalError)
 {
     this.onMessage           = onMessage;
     this.initialize          = initialize;
     this.inputEndpoint       = inputEndpoint;
     this.rawEndpointFactory  = rawEndpointFactory;
     this.errorHandlingPolicy = errorHandlingPolicy;
     this.onCriticalError     = onCriticalError;
 }
 /// <summary>
 /// Instructs the endpoint to use a custom error handling policy.
 /// </summary>
 public void CustomErrorHandlingPolicy(IErrorHandlingPolicy customPolicy)
 {
     Guard.AgainstNull(nameof(customPolicy), customPolicy);
     Settings.Set(customPolicy);
 }