Exemple #1
0
 public GatewayConnectionListener(
     IServiceProvider serviceProvider,
     IOptions <ConnectionOptions> connectionOptions,
     IConnectionListenerFactory listenerFactory,
     MessageFactory messageFactory,
     OverloadDetector overloadDetector,
     Gateway gateway,
     INetworkingTrace trace,
     ILocalSiloDetails localSiloDetails,
     IOptions <MultiClusterOptions> multiClusterOptions,
     IOptions <EndpointOptions> endpointOptions,
     MessageCenter messageCenter,
     ISiloStatusOracle siloStatusOracle)
     : base(serviceProvider, listenerFactory, connectionOptions, trace)
 {
     this.messageFactory      = messageFactory;
     this.overloadDetector    = overloadDetector;
     this.gateway             = gateway;
     this.trace               = trace;
     this.localSiloDetails    = localSiloDetails;
     this.multiClusterOptions = multiClusterOptions;
     this.messageCenter       = messageCenter;
     this.siloStatusOracle    = siloStatusOracle;
     this.endpointOptions     = endpointOptions.Value;
 }
Exemple #2
0
 public GatewayConnectionListener(
     IServiceProvider serviceProvider,
     IOptions <ConnectionOptions> connectionOptions,
     IOptions <SiloConnectionOptions> siloConnectionOptions,
     MessageFactory messageFactory,
     OverloadDetector overloadDetector,
     Gateway gateway,
     INetworkingTrace trace,
     ILocalSiloDetails localSiloDetails,
     IOptions <MultiClusterOptions> multiClusterOptions,
     IOptions <EndpointOptions> endpointOptions,
     MessageCenter messageCenter,
     ConnectionManager connectionManager)
     : base(serviceProvider, serviceProvider.GetRequiredServiceByKey <object, IConnectionListenerFactory>(ServicesKey), connectionOptions, connectionManager, trace)
 {
     this.siloConnectionOptions = siloConnectionOptions.Value;
     this.messageFactory        = messageFactory;
     this.overloadDetector      = overloadDetector;
     this.gateway             = gateway;
     this.trace               = trace;
     this.localSiloDetails    = localSiloDetails;
     this.multiClusterOptions = multiClusterOptions;
     this.messageCenter       = messageCenter;
     this.endpointOptions     = endpointOptions.Value;
 }
Exemple #3
0
 public GatewayInboundConnection(
     ConnectionContext connection,
     ConnectionDelegate middleware,
     IServiceProvider serviceProvider,
     Gateway gateway,
     OverloadDetector overloadDetector,
     MessageFactory messageFactory,
     INetworkingTrace trace,
     ILocalSiloDetails siloDetails,
     IOptions <MultiClusterOptions> multiClusterOptions,
     ConnectionOptions connectionOptions,
     MessageCenter messageCenter,
     ILocalSiloDetails localSiloDetails)
     : base(connection, middleware, messageFactory, serviceProvider, trace)
 {
     this.connectionOptions      = connectionOptions;
     this.gateway                = gateway;
     this.overloadDetector       = overloadDetector;
     this.siloDetails            = siloDetails;
     this.messageCenter          = messageCenter;
     this.multiClusterOptions    = multiClusterOptions.Value;
     this.loadSheddingCounter    = CounterStatistic.FindOrCreate(StatisticNames.GATEWAY_LOAD_SHEDDING);
     this.myAddress              = localSiloDetails.SiloAddress;
     this.MessageReceivedCounter = CounterStatistic.FindOrCreate(StatisticNames.GATEWAY_RECEIVED);
     this.MessageSentCounter     = CounterStatistic.FindOrCreate(StatisticNames.GATEWAY_SENT);
 }
 internal GatewayAcceptor(
     MessageCenter msgCtr,
     Gateway gateway,
     IPEndPoint gatewayAddress,
     MessageFactory messageFactory,
     SerializationManager serializationManager,
     ExecutorService executorService,
     ILocalSiloDetails siloDetails,
     IOptions <MultiClusterOptions> multiClusterOptions,
     ILoggerFactory loggerFactory,
     OverloadDetector overloadDetector)
     : base(msgCtr, gatewayAddress, SocketDirection.GatewayToClient, messageFactory, serializationManager, executorService, loggerFactory)
 {
     this.gateway               = gateway;
     this.loadSheddingCounter   = CounterStatistic.FindOrCreate(StatisticNames.GATEWAY_LOAD_SHEDDING);
     this.gatewayTrafficCounter = CounterStatistic.FindOrCreate(StatisticNames.GATEWAY_RECEIVED);
     this.siloDetails           = siloDetails;
     this.overloadDetector      = overloadDetector;
     this.multiClusterOptions   = multiClusterOptions.Value;
 }
Exemple #5
0
 public GatewayConnectionListener(
     IServiceProvider serviceProvider,
     IOptions <ConnectionOptions> connectionOptions,
     IOptions <SiloConnectionOptions> siloConnectionOptions,
     OverloadDetector overloadDetector,
     ILocalSiloDetails localSiloDetails,
     IOptions <EndpointOptions> endpointOptions,
     MessageCenter messageCenter,
     ConnectionManager connectionManager,
     ConnectionCommon connectionShared)
     : base(serviceProvider.GetRequiredServiceByKey <object, IConnectionListenerFactory>(ServicesKey), connectionOptions, connectionManager, connectionShared)
 {
     this.siloConnectionOptions = siloConnectionOptions.Value;
     this.overloadDetector      = overloadDetector;
     this.gateway          = messageCenter.Gateway;
     this.localSiloDetails = localSiloDetails;
     this.messageCenter    = messageCenter;
     this.connectionShared = connectionShared;
     this.endpointOptions  = endpointOptions.Value;
 }
 public GatewayInboundConnection(
     ConnectionContext connection,
     ConnectionDelegate middleware,
     Gateway gateway,
     OverloadDetector overloadDetector,
     ILocalSiloDetails siloDetails,
     ConnectionOptions connectionOptions,
     MessageCenter messageCenter,
     ConnectionCommon connectionShared)
     : base(connection, middleware, connectionShared)
 {
     this.connectionOptions      = connectionOptions;
     this.gateway                = gateway;
     this.overloadDetector       = overloadDetector;
     this.siloDetails            = siloDetails;
     this.messageCenter          = messageCenter;
     this.loadSheddingCounter    = CounterStatistic.FindOrCreate(StatisticNames.GATEWAY_LOAD_SHEDDING);
     this.myAddress              = siloDetails.SiloAddress;
     this.MessageReceivedCounter = CounterStatistic.FindOrCreate(StatisticNames.GATEWAY_RECEIVED);
     this.MessageSentCounter     = CounterStatistic.FindOrCreate(StatisticNames.GATEWAY_SENT);
 }
Exemple #7
0
 public Gateway(
     MessageCenter msgCtr,
     ILocalSiloDetails siloDetails,
     MessageFactory messageFactory,
     SerializationManager serializationManager,
     ExecutorService executorService,
     ILoggerFactory loggerFactory,
     IOptions <EndpointOptions> endpointOptions,
     IOptions <SiloMessagingOptions> options,
     IOptions <MultiClusterOptions> multiClusterOptions,
     OverloadDetector overloadDetector)
 {
     this.messagingOptions     = options.Value;
     this.loggerFactory        = loggerFactory;
     messageCenter             = msgCtr;
     this.messageFactory       = messageFactory;
     this.logger               = this.loggerFactory.CreateLogger <Gateway>();
     this.serializationManager = serializationManager;
     this.executorService      = executorService;
     acceptor = new GatewayAcceptor(
         msgCtr,
         this,
         endpointOptions.Value.GetListeningProxyEndpoint(),
         this.messageFactory,
         this.serializationManager,
         executorService,
         siloDetails,
         multiClusterOptions,
         loggerFactory,
         overloadDetector);
     senders = new Lazy <GatewaySender> [messagingOptions.GatewaySenderQueues];
     nextGatewaySenderToUseForRoundRobin = 0;
     dropper                  = new GatewayClientCleanupAgent(this, executorService, loggerFactory, messagingOptions.ClientDropTimeout);
     clients                  = new ConcurrentDictionary <GrainId, ClientState>();
     clientSockets            = new ConcurrentDictionary <Socket, ClientState>();
     clientsReplyRoutingCache = new ClientsReplyRoutingCache(messagingOptions.ResponseTimeout);
     this.gatewayAddress      = siloDetails.GatewayAddress;
     lockable                 = new object();
 }