コード例 #1
0
        private void Initialize(IOptions <EndpointOptions> endpointOptions,
                                IOptions <SiloMessagingOptions> messagingOptions,
                                IOptions <NetworkingOptions> networkingOptions,
                                IOptions <StatisticsOptions> statisticsOptions)
        {
            if (log.IsEnabled(LogLevel.Trace))
            {
                log.Trace("Starting initialization.");
            }

            SocketManager = new SocketManager(networkingOptions, this.loggerFactory);
            var listeningEndpoint = endpointOptions.Value.GetListeningSiloEndpoint();

            ima = new IncomingMessageAcceptor(this,
                                              listeningEndpoint,
                                              SocketDirection.SiloToSilo,
                                              this.messageFactory,
                                              this.serializationManager,
                                              this.executorService,
                                              this.loggerFactory);
            InboundQueue  = new InboundMessageQueue(this.loggerFactory, statisticsOptions);
            OutboundQueue = new OutboundMessageQueue(this, messagingOptions, this.serializationManager, this.executorService, this.loggerFactory);

            sendQueueLengthCounter    = IntValueStatistic.FindOrCreate(StatisticNames.MESSAGE_CENTER_SEND_QUEUE_LENGTH, () => SendQueueLength);
            receiveQueueLengthCounter = IntValueStatistic.FindOrCreate(StatisticNames.MESSAGE_CENTER_RECEIVE_QUEUE_LENGTH, () => ReceiveQueueLength);

            if (log.IsEnabled(LogLevel.Trace))
            {
                log.Trace("Completed initialization.");
            }
        }
コード例 #2
0
ファイル: MessageCenter.cs プロジェクト: wangyuzhu/orleans
        private void Initialize(IOptions <NetworkingOptions> networkingOptions, IOptions <StatisticsOptions> statisticsOptions)
        {
            if (log.IsEnabled(LogLevel.Trace))
            {
                log.Trace("Starting initialization.");
            }

            inboundQueue  = new InboundMessageQueue(this.loggerFactory.CreateLogger <InboundMessageQueue>(), statisticsOptions);
            OutboundQueue = new OutboundMessageQueue(this, this.loggerFactory.CreateLogger <OutboundMessageQueue>(), this.senderManager);

            if (log.IsEnabled(LogLevel.Trace))
            {
                log.Trace("Completed initialization.");
            }
        }
コード例 #3
0
ファイル: MessageCenter.cs プロジェクト: thakursagar/orleans
        private void Initialize(IPEndPoint here, int generation, IMessagingConfiguration config, ISiloPerformanceMetrics metrics = null)
        {
            if(log.IsVerbose3) log.Verbose3("Starting initialization.");

            SocketManager = new SocketManager(config);
            ima = new IncomingMessageAcceptor(this, here, SocketDirection.SiloToSilo, this.messageFactory, this.serializationManager);
            MyAddress = SiloAddress.New((IPEndPoint)ima.AcceptingSocket.LocalEndPoint, generation);
            MessagingConfiguration = config;
            InboundQueue = new InboundMessageQueue();
            OutboundQueue = new OutboundMessageQueue(this, config, this.serializationManager);
            Gateway = null;
            Metrics = metrics;
            
            sendQueueLengthCounter = IntValueStatistic.FindOrCreate(StatisticNames.MESSAGE_CENTER_SEND_QUEUE_LENGTH, () => SendQueueLength);
            receiveQueueLengthCounter = IntValueStatistic.FindOrCreate(StatisticNames.MESSAGE_CENTER_RECEIVE_QUEUE_LENGTH, () => ReceiveQueueLength);

            if (log.IsVerbose3) log.Verbose3("Completed initialization.");
        }
コード例 #4
0
ファイル: MessageCenter.cs プロジェクト: Rejendo/orleans
        private void Initialize(IPEndPoint here, int generation, IMessagingConfiguration config, ISiloPerformanceMetrics metrics = null)
        {
            if(log.IsVerbose3) log.Verbose3("Starting initialization.");

            SocketManager = new SocketManager(config);
            ima = new IncomingMessageAcceptor(this, here, SocketDirection.SiloToSilo);
            MyAddress = SiloAddress.New((IPEndPoint)ima.AcceptingSocket.LocalEndPoint, generation);
            MessagingConfiguration = config;
            InboundQueue = new InboundMessageQueue();
            OutboundQueue = new OutboundMessageQueue(this, config);
            Gateway = null;
            Metrics = metrics;
            
            sendQueueLengthCounter = IntValueStatistic.FindOrCreate(StatisticNames.MESSAGE_CENTER_SEND_QUEUE_LENGTH, () => SendQueueLength);
            receiveQueueLengthCounter = IntValueStatistic.FindOrCreate(StatisticNames.MESSAGE_CENTER_RECEIVE_QUEUE_LENGTH, () => ReceiveQueueLength);

            if (log.IsVerbose3) log.Verbose3("Completed initialization.");
        }
コード例 #5
0
        private void Initialize(IPEndPoint here, int generation, IOptions <SiloMessagingOptions> messagingOptions, IOptions <NetworkingOptions> networkingOptions)
        {
            if (log.IsEnabled(LogLevel.Trace))
            {
                log.Trace("Starting initialization.");
            }

            SocketManager = new SocketManager(networkingOptions, this.loggerFactory);
            ima           = new IncomingMessageAcceptor(this, here, SocketDirection.SiloToSilo, this.messageFactory, this.serializationManager, this.executorService, this.loggerFactory);
            MyAddress     = SiloAddress.New((IPEndPoint)ima.AcceptingSocket.LocalEndPoint, generation);
            InboundQueue  = new InboundMessageQueue(this.loggerFactory);
            OutboundQueue = new OutboundMessageQueue(this, messagingOptions, this.serializationManager, this.executorService, this.loggerFactory);

            sendQueueLengthCounter    = IntValueStatistic.FindOrCreate(StatisticNames.MESSAGE_CENTER_SEND_QUEUE_LENGTH, () => SendQueueLength);
            receiveQueueLengthCounter = IntValueStatistic.FindOrCreate(StatisticNames.MESSAGE_CENTER_RECEIVE_QUEUE_LENGTH, () => ReceiveQueueLength);

            if (log.IsEnabled(LogLevel.Trace))
            {
                log.Trace("Completed initialization.");
            }
        }
コード例 #6
0
        public MessageCenter(
            ILocalSiloDetails siloDetails,
            IOptions <SiloMessagingOptions> messagingOptions,
            MessageFactory messageFactory,
            Factory <MessageCenter, Gateway> gatewayFactory,
            ILoggerFactory loggerFactory,
            IOptions <StatisticsOptions> statisticsOptions,
            ISiloStatusOracle siloStatusOracle,
            ConnectionManager senderManager,
            MessagingTrace messagingTrace)
        {
            this.messagingOptions = messagingOptions.Value;
            this.loggerFactory    = loggerFactory;
            this.senderManager    = senderManager;
            this.messagingTrace   = messagingTrace;
            this.log            = loggerFactory.CreateLogger <MessageCenter>();
            this.messageFactory = messageFactory;
            this.MyAddress      = siloDetails.SiloAddress;

            if (log.IsEnabled(LogLevel.Trace))
            {
                log.Trace("Starting initialization.");
            }

            inboundQueue  = new InboundMessageQueue(this.loggerFactory.CreateLogger <InboundMessageQueue>(), statisticsOptions, this.messagingTrace);
            OutboundQueue = new OutboundMessageQueue(this, this.loggerFactory.CreateLogger <OutboundMessageQueue>(), this.senderManager, siloStatusOracle, this.messagingTrace);

            if (log.IsEnabled(LogLevel.Trace))
            {
                log.Trace("Completed initialization.");
            }

            if (siloDetails.GatewayAddress != null)
            {
                Gateway = gatewayFactory(this);
            }

            messageHandlers = new Action <Message> [Enum.GetValues(typeof(Message.Categories)).Length];
        }