public ProxiedMessageCenter(ClientConfiguration config, IPAddress localAddress, int gen, GrainId clientId, IGatewayListProvider gatewayListProvider)
 {
     lockable  = new object();
     MyAddress = SiloAddress.New(new IPEndPoint(localAddress, 0), gen);
     ClientId  = clientId;
     Running   = false;
     MessagingConfiguration     = config;
     GatewayManager             = new GatewayManager(config, gatewayListProvider);
     PendingInboundMessages     = new RuntimeQueue <Message>();
     registrarGetSystemTarget   = GrainClient.GetStaticMethodThroughReflection("Orleans", "Orleans.Runtime.ClientObserverRegistrarFactory", "GetSystemTarget", null);
     typeManagerGetSystemTarget = GrainClient.GetStaticMethodThroughReflection("Orleans", "Orleans.Runtime.TypeManagerFactory", "GetSystemTarget", null);
     gatewayConnections         = new Dictionary <Uri, GatewayConnection>();
     numMessages            = 0;
     registeredLocalObjects = new HashSet <GrainId>();
     grainBuckets           = new WeakReference[config.ClientSenderBuckets];
     logger = TraceLogger.GetLogger("Messaging.ProxiedMessageCenter", TraceLogger.LoggerType.Runtime);
     if (logger.IsVerbose)
     {
         logger.Verbose("Proxy grain client constructed");
     }
     IntValueStatistic.FindOrCreate(StatisticNames.CLIENT_CONNECTED_GATEWAY_COUNT, () =>
     {
         lock (gatewayConnections)
         {
             return(gatewayConnections.Values.Count(conn => conn.IsLive));
         }
     });
     if (StatisticsCollector.CollectQueueStats)
     {
         queueTracking = new QueueTrackingStatistic("ClientReceiver");
     }
 }
Example #2
0
 internal InboundMessageQueue()
 {
     int n = Enum.GetValues(typeof(Message.Categories)).Length;
     messageQueues = new RuntimeQueue<Message>[n];
     queueTracking = new QueueTrackingStatistic[n];
     int i = 0;
     foreach (var category in Enum.GetValues(typeof(Message.Categories)))
     {
         messageQueues[i] = new RuntimeQueue<Message>();
         if (StatisticsCollector.CollectQueueStats)
         {
             var queueName = "IncomingMessageAgent." + category;
             queueTracking[i] = new QueueTrackingStatistic(queueName);
             queueTracking[i].OnStartExecution();
         }
         i++;
     }
     log = TraceLogger.GetLogger("Orleans.Messaging.InboundMessageQueue");
 }
Example #3
0
        internal InboundMessageQueue()
        {
            int n = Enum.GetValues(typeof(Message.Categories)).Length;

            messageQueues = new RuntimeQueue <Message> [n];
            queueTracking = new QueueTrackingStatistic[n];
            int i = 0;

            foreach (var category in Enum.GetValues(typeof(Message.Categories)))
            {
                messageQueues[i] = new RuntimeQueue <Message>();
                if (StatisticsCollector.CollectQueueStats)
                {
                    var queueName = "IncomingMessageAgent." + category;
                    queueTracking[i] = new QueueTrackingStatistic(queueName);
                    queueTracking[i].OnStartExecution();
                }
                i++;
            }
            log = TraceLogger.GetLogger("Orleans.Messaging.InboundMessageQueue");
        }
Example #4
0
 public ProxiedMessageCenter(ClientConfiguration config, IPAddress localAddress, int gen, GrainId clientId, IGatewayListProvider gatewayListProvider)
 {
     lockable = new object();
     MyAddress = SiloAddress.New(new IPEndPoint(localAddress, 0), gen);
     ClientId = clientId;
     Running = false;
     MessagingConfiguration = config;
     GatewayManager = new GatewayManager(config, gatewayListProvider);
     PendingInboundMessages = new RuntimeQueue<Message>();
     gatewayConnections = new Dictionary<Uri, GatewayConnection>();
     numMessages = 0;
     grainBuckets = new WeakReference[config.ClientSenderBuckets];
     logger = TraceLogger.GetLogger("Messaging.ProxiedMessageCenter", TraceLogger.LoggerType.Runtime);
     if (logger.IsVerbose) logger.Verbose("Proxy grain client constructed");
     IntValueStatistic.FindOrCreate(StatisticNames.CLIENT_CONNECTED_GATEWAY_COUNT, () =>
         {
             lock (gatewayConnections)
             {
                 return gatewayConnections.Values.Count(conn => conn.IsLive);
             }
         });
     if (StatisticsCollector.CollectQueueStats)
     {
         queueTracking = new QueueTrackingStatistic("ClientReceiver");
     }
 }