コード例 #1
0
        /// <summary>
        /// Creates the specified input gateway.
        /// </summary>
        /// <typeparam name="TMessage">The type of the message.</typeparam>
        /// <param name="inputGateway">The input gateway.</param>
        /// <param name="handlerRepository">The handler repository.</param>
        /// <returns></returns>
        public static Listener <TMessage> Create <TMessage>(IInputGateway <TMessage, MessageHeader> inputGateway, IHandlerRepository handlerRepository) where TMessage : IMessage
        {
            var listener = new Listener <TMessage>(inputGateway, handlerRepository);

            listener.Logger = LoggerManager.Instance;
            return(listener);
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ControlProcessor"/> class.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="inputGateway">The input gateway.</param>
 /// <param name="outputGateway">The output gateway.</param>
 /// <param name="handlerRepository">The handler repository.</param>
 /// <param name="messageBuilder">The message builder.</param>
 /// <param name="reinjectionEngine">The reinjection engine.</param>
 internal ControlProcessor(Identification identification,
                           IInputGateway <IControlMessage, MessageHeader> inputGateway,
                           IOutputGateway <IControlMessage> outputGateway,
                           IHandlerRepository handlerRepository, IMessageBuilder messageBuilder, IReinjectionEngine reinjectionEngine)
     : base(identification, inputGateway, handlerRepository, messageBuilder, reinjectionEngine)
 {
     OutputGateway = outputGateway;
 }
コード例 #3
0
 internal Listener(IInputGateway <TMessage, MessageHeader> inputGateway,
                   IHandlerRepository handlerRepository)
 {
     _inputGateway            = inputGateway;
     _inputGateway.OnMessage += MessageReceived;
     _handlerRepository       = handlerRepository;
     ConfigureStateMachine();
 }
コード例 #4
0
ファイル: ListenerConfigurator.cs プロジェクト: petxo/HermEsb
 /// <summary>
 /// Creates the input.
 /// </summary>
 /// <returns></returns>
 private ListenerConfigurator CreateInput()
 {
     var uri = new Uri(_listenerConfig.Input.Uri);
     _input = AgentGatewayFactory.CreateInputGateway<IMessage>(uri, _listenerConfig.Input.Transport,
                                                                         _listenerConfig.NumberOfParallelTasks,
                                                                         _listenerConfig.MaxReijections);
     return this;
 }
コード例 #5
0
 private RouterProcessorConfigurator LoadHelpers()
 {
     var uri = new Uri(_hermEsbConfig.RouterProcessor.Input.Uri);
     _input = RouterGatewayFactory.CreateInputGateway(uri,
                                                     _hermEsbConfig.RouterProcessor.Input.Transport,
                                                     _hermEsbConfig.RouterProcessor.NumberOfParallelTasks,
                                                     _hermEsbConfig.RouterProcessor.MaxReijections);
     return this;
 }
コード例 #6
0
ファイル: ProcessorsFactory.cs プロジェクト: petxo/HermEsb
 /// <summary>
 ///     Creates the router processor.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="inputGateway">The input gateway.</param>
 /// <param name="routerOutputHelper">The router output helper.</param>
 /// <returns></returns>
 public static IProcessor CreateRouterProcessor(Identification identification,
                                                IInputGateway<byte[], RouterHeader> inputGateway,
                                                IRouterOutputHelper routerOutputHelper)
 {
     return new RouterProcessor(identification, inputGateway, routerOutputHelper)
         {
             Logger = LoggerManager.Instance
         };
 }
コード例 #7
0
 /// <summary>
 ///     Creates the router processor.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="inputGateway">The input gateway.</param>
 /// <param name="routerOutputHelper">The router output helper.</param>
 /// <returns></returns>
 public static IProcessor CreateRouterProcessor(Identification identification,
                                                IInputGateway <byte[], RouterHeader> inputGateway,
                                                IRouterOutputHelper routerOutputHelper)
 {
     return(new RouterProcessor(identification, inputGateway, routerOutputHelper)
     {
         Logger = LoggerManager.Instance
     });
 }
コード例 #8
0
        /// <summary>
        /// Creates the input.
        /// </summary>
        /// <returns></returns>
        private ListenerConfigurator CreateInput()
        {
            var uri = new Uri(_listenerConfig.Input.Uri);

            _input = AgentGatewayFactory.CreateInputGateway <IMessage>(uri, _listenerConfig.Input.Transport,
                                                                       _listenerConfig.NumberOfParallelTasks,
                                                                       _listenerConfig.MaxReijections);
            return(this);
        }
コード例 #9
0
        private RouterProcessorConfigurator LoadHelpers()
        {
            var uri = new Uri(_hermEsbConfig.RouterProcessor.Input.Uri);

            _input = RouterGatewayFactory.CreateInputGateway(uri,
                                                             _hermEsbConfig.RouterProcessor.Input.Transport,
                                                             _hermEsbConfig.RouterProcessor.NumberOfParallelTasks,
                                                             _hermEsbConfig.RouterProcessor.MaxReijections);
            return(this);
        }
コード例 #10
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="RouterProcessor" /> class.
        /// </summary>
        /// <param name="identification">The identification.</param>
        /// <param name="inputGateway">The message receiver.</param>
        /// <param name="routerOutputHelper">The bus sender helper.</param>
        internal RouterProcessor(Identification identification, IInputGateway <byte[], RouterHeader> inputGateway,
                                 IRouterOutputHelper routerOutputHelper)
        {
            JoinedBusInfo = BusInfo.Create();

            ConfigureStateMachine();
            _inputGateway            = inputGateway;
            _identification          = identification;
            _routerOutputHelper      = routerOutputHelper;
            _inputGateway.OnMessage += MessageReceived;
            _stateMachine.ChangeState(ProcessorStatus.Configured);
            _serializer = new JsonDataContractSerializer();
        }
コード例 #11
0
        /// <summary>
        ///     Creates the input.
        /// </summary>
        /// <returns></returns>
        private RouterControlConfigurator CreateInput()
        {
            var uri = new Uri(_hermEsbConfig.RouterControlProcessor.Input.Uri);
            _input = AgentGatewayFactory.CreateInputGateway<IControlMessage>(uri,
                                                                             _hermEsbConfig.RouterControlProcessor
                                                                                             .Input.Transport,
                                                                             _hermEsbConfig.RouterControlProcessor
                                                                                             .NumberOfParallelTasks,
                                                                             _hermEsbConfig.RouterControlProcessor
                                                                                             .MaxReijections);

            return this;
        }
コード例 #12
0
        /// <summary>
        ///     Creates the router control processor.
        /// </summary>
        /// <param name="identification">The identification.</param>
        /// <param name="inputGateway">The input gateway.</param>
        /// <param name="handlerRepository">The handler repository.</param>
        /// <param name="subscriptorsHelper">The subscriptors helper.</param>
        /// <returns></returns>
        public static IController CreateRouterControlProcessor(Identification identification,
                                                               IInputGateway <IControlMessage, MessageHeader> inputGateway,
                                                               IHandlerRepository handlerRepository,
                                                               ISubscriptorsHelper subscriptorsHelper)
        {
            IMessageBuilder defaultObjectBuilder = MessageBuilderFactory.CreateDefaultBuilder();

            return(new RouterControlProcessor(identification, inputGateway, handlerRepository, subscriptorsHelper,
                                              defaultObjectBuilder)
            {
                Logger = LoggerManager.Instance
            });
        }
コード例 #13
0
 /// <summary>
 ///     Creates the service processor.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="inputGateway">The input gateway.</param>
 /// <param name="handlerRepository">The handler repository.</param>
 /// <param name="messageBuilder">The message builder.</param>
 /// <returns></returns>
 public static IProcessor CreateServiceProcessor(Identification identification,
                                                 IInputGateway <IMessage, MessageHeader> inputGateway,
                                                 IHandlerRepository handlerRepository,
                                                 IMessageBuilder messageBuilder)
 {
     return(new ServiceProcessor(identification,
                                 inputGateway,
                                 handlerRepository,
                                 messageBuilder, ReinjectionEngineFactory.CreateDefaultEngine(inputGateway))
     {
         Logger = LoggerManager.Instance
     });
 }
コード例 #14
0
ファイル: RouterProcessor.cs プロジェクト: petxo/HermEsb
        /// <summary>
        ///     Initializes a new instance of the <see cref="RouterProcessor" /> class.
        /// </summary>
        /// <param name="identification">The identification.</param>
        /// <param name="inputGateway">The message receiver.</param>
        /// <param name="routerOutputHelper">The bus sender helper.</param>
        internal RouterProcessor(Identification identification, IInputGateway<byte[], RouterHeader> inputGateway,
                                 IRouterOutputHelper routerOutputHelper)
        {
            JoinedBusInfo = BusInfo.Create();

            ConfigureStateMachine();
            _inputGateway = inputGateway;
            _identification = identification;
            _routerOutputHelper = routerOutputHelper;
            _inputGateway.OnMessage += MessageReceived;
            _stateMachine.ChangeState(ProcessorStatus.Configured);
            _serializer = new JsonDataContractSerializer();
        }
コード例 #15
0
ファイル: ProcessorsFactory.cs プロジェクト: petxo/HermEsb
        /// <summary>
        ///     Creates the router control processor.
        /// </summary>
        /// <param name="identification">The identification.</param>
        /// <param name="inputGateway">The input gateway.</param>
        /// <param name="handlerRepository">The handler repository.</param>
        /// <param name="subscriptorsHelper">The subscriptors helper.</param>
        /// <returns></returns>
        public static IController CreateRouterControlProcessor(Identification identification,
                                                               IInputGateway<IControlMessage, MessageHeader> inputGateway,
                                                               IHandlerRepository handlerRepository,
                                                               ISubscriptorsHelper subscriptorsHelper)
        {
            IMessageBuilder defaultObjectBuilder = MessageBuilderFactory.CreateDefaultBuilder();

            return new RouterControlProcessor(identification, inputGateway, handlerRepository, subscriptorsHelper,
                                              defaultObjectBuilder)
                {
                    Logger = LoggerManager.Instance
                };
        }
コード例 #16
0
        /// <summary>
        ///     Creates the input.
        /// </summary>
        /// <returns></returns>
        private RouterControlConfigurator CreateInput()
        {
            var uri = new Uri(_hermEsbConfig.RouterControlProcessor.Input.Uri);

            _input = AgentGatewayFactory.CreateInputGateway <IControlMessage>(uri,
                                                                              _hermEsbConfig.RouterControlProcessor
                                                                              .Input.Transport,
                                                                              _hermEsbConfig.RouterControlProcessor
                                                                              .NumberOfParallelTasks,
                                                                              _hermEsbConfig.RouterControlProcessor
                                                                              .MaxReijections);

            return(this);
        }
コード例 #17
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="RouterControlProcessor" /> class.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="inputGateway">The input gateway.</param>
 /// <param name="handlerRepository">The handler repository.</param>
 /// <param name="subscriptonsHelper">The subscriptors helper.</param>
 /// <param name="messageBuilder">The message builder.</param>
 internal RouterControlProcessor(Identification identification,
                                 IInputGateway <IControlMessage, MessageHeader> inputGateway,
                                 IHandlerRepository handlerRepository,
                                 ISubscriptorsHelper subscriptonsHelper,
                                 IMessageBuilder messageBuilder)
 {
     ConfigureStateMachine();
     _identification                = identification;
     _inputGateway                  = inputGateway;
     _inputGateway.OnMessage       += MessageReceived;
     _handlerRepository             = handlerRepository;
     _subscriptonsHelper            = subscriptonsHelper;
     _subscriptonsHelper.Controller = this;
     _messageBuilder                = messageBuilder;
 }
コード例 #18
0
ファイル: ProcessorsFactory.cs プロジェクト: petxo/HermEsb
 /// <summary>
 ///     Creates the control processor.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="inputGateway">The input gateway.</param>
 /// <param name="outputGateway">The output gateway.</param>
 /// <param name="handlerRepository">The handler repository.</param>
 /// <returns></returns>
 public static IController CreateControlProcessor(Identification identification,
                                                  IInputGateway<IControlMessage, MessageHeader> inputGateway,
                                                  IOutputGateway<IControlMessage> outputGateway,
                                                  IHandlerRepository handlerRepository)
 {
     return new ControlProcessor(identification,
                                 inputGateway,
                                 outputGateway,
                                 handlerRepository,
                                 MessageBuilderFactory.CreateDefaultBuilder(),
                                 ReinjectionEngineFactory.CreateDefaultEngine(inputGateway))
         {
             Logger = LoggerManager.Instance
         };
 }
コード例 #19
0
 /// <summary>
 ///     Creates the control processor.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="inputGateway">The input gateway.</param>
 /// <param name="outputGateway">The output gateway.</param>
 /// <param name="handlerRepository">The handler repository.</param>
 /// <returns></returns>
 public static IController CreateControlProcessor(Identification identification,
                                                  IInputGateway <IControlMessage, MessageHeader> inputGateway,
                                                  IOutputGateway <IControlMessage> outputGateway,
                                                  IHandlerRepository handlerRepository)
 {
     return(new ControlProcessor(identification,
                                 inputGateway,
                                 outputGateway,
                                 handlerRepository,
                                 MessageBuilderFactory.CreateDefaultBuilder(),
                                 ReinjectionEngineFactory.CreateDefaultEngine(inputGateway))
     {
         Logger = LoggerManager.Instance
     });
 }
コード例 #20
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="RouterControlProcessor" /> class.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="inputGateway">The input gateway.</param>
 /// <param name="handlerRepository">The handler repository.</param>
 /// <param name="subscriptonsHelper">The subscriptors helper.</param>
 /// <param name="messageBuilder">The message builder.</param>
 internal RouterControlProcessor(Identification identification,
                                 IInputGateway<IControlMessage, MessageHeader> inputGateway,
                                 IHandlerRepository handlerRepository,
                                 ISubscriptorsHelper subscriptonsHelper,
                                 IMessageBuilder messageBuilder)
 {
     ConfigureStateMachine();
     _identification = identification;
     _inputGateway = inputGateway;
     _inputGateway.OnMessage += MessageReceived;
     _handlerRepository = handlerRepository;
     _subscriptonsHelper = subscriptonsHelper;
     _subscriptonsHelper.Controller = this;
     _messageBuilder = messageBuilder;
 }
コード例 #21
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Agent{TMessage}" /> class.
        /// </summary>
        /// <param name="identification">The identification.</param>
        /// <param name="inputGateway">The input gateway.</param>
        /// <param name="handlerRepository">The handler repository.</param>
        /// <param name="messageBuilder">The message builder.</param>
        /// <param name="reinjectionEngine">The reinjection engine.</param>
        protected Agent(Identification identification,
                        IInputGateway <TMessage, MessageHeader> inputGateway,
                        IHandlerRepository handlerRepository, IMessageBuilder messageBuilder,
                        IReinjectionEngine reinjectionEngine)
        {
            JoinedBusInfo = BusInfo.Create();

            ConfigureStateMachine();

            _identification          = identification;
            _messageBuilder          = messageBuilder;
            _reinjectionEngine       = reinjectionEngine;
            _inputGateway            = inputGateway;
            _inputGateway.OnMessage += MessageReceived;
            _handlerRepository       = handlerRepository;
        }
コード例 #22
0
 /// <summary>
 /// Creates the direct engine.
 /// </summary>
 /// <typeparam name="TMessage">The type of the message.</typeparam>
 /// <param name="inputGateway">The input gateway.</param>
 /// <returns></returns>
 public static IReinjectionEngine CreateDefaultEngine <TMessage>(IInputGateway <TMessage, MessageHeader> inputGateway)
 {
     return(new DirectReinjectionEngine <TMessage>(inputGateway));
 }
コード例 #23
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="DirectReinjectionEngine{TMessage}" /> class.
 /// </summary>
 /// <param name="inputGateway">The input gateway.</param>
 public DirectReinjectionEngine(IInputGateway <TMessage, MessageHeader> inputGateway)
 {
     _inputGateway = inputGateway;
     InitializeStateMachine();
 }
コード例 #24
0
ファイル: ProcessorsFactory.cs プロジェクト: petxo/HermEsb
 /// <summary>
 ///     Creates the service processor.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="inputGateway">The input gateway.</param>
 /// <param name="handlerRepository">The handler repository.</param>
 /// <param name="messageBuilder">The message builder.</param>
 /// <returns></returns>
 public static IProcessor CreateServiceProcessor(Identification identification,
                                                 IInputGateway<IMessage, MessageHeader> inputGateway,
                                                 IHandlerRepository handlerRepository,
                                                 IMessageBuilder messageBuilder)
 {
     return new ServiceProcessor(identification,
                                 inputGateway,
                                 handlerRepository,
                                 messageBuilder, ReinjectionEngineFactory.CreateDefaultEngine(inputGateway))
         {
             Logger = LoggerManager.Instance
         };
 }
コード例 #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceProcessor"/> class.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="inputGateway">The input gateway.</param>
 /// <param name="handlerRepository">The handler repository.</param>
 /// <param name="messageBuilder">The message builder.</param>
 /// <param name="reinjectionEngine">The reinjection engine.</param>
 internal ServiceProcessor(Identification identification,
                           IInputGateway <IMessage, MessageHeader> inputGateway,
                           IHandlerRepository handlerRepository, IMessageBuilder messageBuilder, IReinjectionEngine reinjectionEngine)
     : base(identification, inputGateway, handlerRepository, messageBuilder, reinjectionEngine)
 {
 }
コード例 #26
0
ファイル: AgentFake.cs プロジェクト: yashhotline/HermEsb
 /// <summary>
 /// Initializes a new instance of the <see cref="AgentFake"/> class.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="inputGateway">The input gateway.</param>
 /// <param name="handlerRepository">The handler repository.</param>
 public AgentFake(Identification identification, IInputGateway <IMessage, MessageHeader> inputGateway, IHandlerRepository handlerRepository)
     : base(identification, inputGateway, handlerRepository, MessageBuilderFactory.CreateDefaultBuilder(), ReinjectionEngineFactory.CreateDefaultEngine(inputGateway))
 {
 }