public OutsideRuntimeClient(
            ILoggerFactory loggerFactory,
            IOptions <ClientMessagingOptions> clientMessagingOptions,
            IOptions <TypeManagementOptions> typeManagementOptions,
            IOptions <StatisticsOptions> statisticsOptions,
            ApplicationRequestsStatisticsGroup appRequestStatistics,
            StageAnalysisStatisticsGroup schedulerStageStatistics,
            ClientStatisticsManager clientStatisticsManager,
            MessagingTrace messagingTrace)
        {
            this.loggerFactory            = loggerFactory;
            this.statisticsOptions        = statisticsOptions;
            this.appRequestStatistics     = appRequestStatistics;
            this.schedulerStageStatistics = schedulerStageStatistics;
            this.ClientStatistics         = clientStatisticsManager;
            this.messagingTrace           = messagingTrace;
            this.logger            = loggerFactory.CreateLogger <OutsideRuntimeClient>();
            this.handshakeClientId = GrainId.NewClientId();
            callbacks = new ConcurrentDictionary <CorrelationId, CallbackData>();
            this.clientMessagingOptions = clientMessagingOptions.Value;
            this.typeMapRefreshInterval = typeManagementOptions.Value.TypeMapRefreshInterval;

            this.sharedCallbackData = new SharedCallbackData(
                msg => this.UnregisterCallback(msg.Id),
                this.loggerFactory.CreateLogger <CallbackData>(),
                this.clientMessagingOptions,
                this.appRequestStatistics,
                this.clientMessagingOptions.ResponseTimeout);
        }
示例#2
0
        public MessageCenter(
            ILocalSiloDetails siloDetails,
            IOptions <SiloMessagingOptions> messagingOptions,
            MessageFactory messageFactory,
            Factory <MessageCenter, Gateway> gatewayFactory,
            ILoggerFactory loggerFactory,
            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.");
            }

            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);
            }
        }
示例#3
0
        internal InboundMessageQueue(ILogger <InboundMessageQueue> log, IOptions <StatisticsOptions> statisticsOptions, MessagingTrace messagingTrace)
        {
            this.log            = log;
            this.messagingTrace = messagingTrace;
            int n = Enum.GetValues(typeof(Message.Categories)).Length;

            this.messageQueues = new Channel <Message> [n];
            this.queueTracking = new QueueTrackingStatistic[n];
            int i = 0;

            this.statisticsLevel = statisticsOptions.Value.CollectionLevel;
            foreach (var category in Enum.GetValues(typeof(Message.Categories)))
            {
                this.messageQueues[i] = Channel.CreateUnbounded <Message>(new UnboundedChannelOptions
                {
                    SingleReader = true,
                    SingleWriter = false,
                    AllowSynchronousContinuations = false
                });

                if (this.statisticsLevel.CollectQueueStats())
                {
                    var queueName = "IncomingMessageAgent." + category;
                    this.queueTracking[i] = new QueueTrackingStatistic(queueName, statisticsOptions);
                    this.queueTracking[i].OnStartExecution();
                }

                i++;
            }
        }
示例#4
0
 public ConnectionCommon(
     IServiceProvider serviceProvider,
     MessageFactory messageFactory,
     MessagingTrace messagingTrace,
     NetworkingTrace networkingTrace)
 {
     this.ServiceProvider = serviceProvider;
     this.MessageFactory  = messageFactory;
     this.MessagingTrace  = messagingTrace;
     this.NetworkingTrace = networkingTrace;
 }
示例#5
0
 public InvokableObjectManager(
     IGrainContext rootGrainContext,
     IRuntimeClient runtimeClient,
     DeepCopier deepCopier,
     MessagingTrace messagingTrace,
     ILogger logger)
 {
     this.rootGrainContext = rootGrainContext;
     this.runtimeClient    = runtimeClient;
     this.deepCopier       = deepCopier;
     this.messagingTrace   = messagingTrace;
     this.logger           = logger;
 }
示例#6
0
 public InvokableObjectManager(
     IGrainContext rootGrainContext,
     IRuntimeClient runtimeClient,
     SerializationManager serializationManager,
     MessagingTrace messagingTrace,
     ILogger logger)
 {
     this.rootGrainContext     = rootGrainContext;
     this.runtimeClient        = runtimeClient;
     this.serializationManager = serializationManager;
     this.messagingTrace       = messagingTrace;
     this.logger = logger;
 }
示例#7
0
 internal OutboundMessageQueue(
     MessageCenter mc,
     ILogger <OutboundMessageQueue> logger,
     ConnectionManager senderManager,
     ISiloStatusOracle siloStatusOracle,
     MessagingTrace messagingTrace)
 {
     messageCenter          = mc;
     this.connectionManager = senderManager;
     this.siloStatusOracle  = siloStatusOracle;
     this.messagingTrace    = messagingTrace;
     this.logger            = logger;
     stopped = false;
 }
示例#8
0
        public InvokableObjectManager(
            IRuntimeClient runtimeClient,
            SerializationManager serializationManager,
            MessagingTrace messagingTrace,
            ILogger <InvokableObjectManager> logger)
        {
            this.runtimeClient        = runtimeClient;
            this.serializationManager = serializationManager;
            this.messagingTrace       = messagingTrace;
            this.logger = logger;

            this.dispatchFunc = o =>
                                this.LocalObjectMessagePumpAsync((LocalObjectData)o);
        }
示例#9
0
 internal IncomingMessageHandler(
     MessageCenter mc,
     ActivationDirectory ad,
     OrleansTaskScheduler sched,
     Dispatcher dispatcher,
     MessageFactory messageFactory,
     ILogger <IncomingMessageHandler> log,
     MessagingTrace messagingTrace)
 {
     this.messageCenter  = mc;
     this.directory      = ad;
     this.scheduler      = sched;
     this.dispatcher     = dispatcher;
     this.messageFactory = messageFactory;
     this.log            = log;
     this.messagingTrace = messagingTrace;
 }
 internal IncomingMessageAgent(
     Message.Categories cat,
     IMessageCenter mc,
     ActivationDirectory ad,
     OrleansTaskScheduler sched,
     Dispatcher dispatcher,
     MessageFactory messageFactory,
     ILoggerFactory loggerFactory,
     MessagingTrace messagingTrace) :
     base(cat.ToString(), loggerFactory)
 {
     category            = cat;
     messageCenter       = mc;
     directory           = ad;
     scheduler           = sched;
     this.dispatcher     = dispatcher;
     this.messageFactory = messageFactory;
     this.messagingTrace = messagingTrace;
     OnFault             = FaultBehavior.RestartOnFault;
     messageCenter.RegisterLocalMessageHandler(cat, ReceiveMessage);
 }
示例#11
0
        public MessageCenter(
            ILocalSiloDetails siloDetails,
            MessageFactory messageFactory,
            Factory <MessageCenter, Gateway> gatewayFactory,
            ILogger <MessageCenter> logger,
            ISiloStatusOracle siloStatusOracle,
            ConnectionManager senderManager,
            MessagingTrace messagingTrace)
        {
            this.siloStatusOracle  = siloStatusOracle;
            this.connectionManager = senderManager;
            this.messagingTrace    = messagingTrace;
            this.log            = logger;
            this.messageFactory = messageFactory;
            this._siloAddress   = siloDetails.SiloAddress;

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