Esempio n. 1
0
 public Gateway(MessageCenter msgCtr, ILocalSiloDetails siloDetails, MessageFactory messageFactory, SerializationManager serializationManager, ExecutorService executorService, ILoggerFactory loggerFactory, 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,
         siloDetails.GatewayAddress?.Endpoint,
         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();
 }
Esempio n. 2
0
 internal Gateway(MessageCenter msgCtr, IPEndPoint gatewayAddress)
 {
     messageCenter = msgCtr;
     acceptor      = new GatewayAcceptor(msgCtr, this, gatewayAddress);
     senders       = new Lazy <GatewaySender> [messageCenter.MessagingConfiguration.GatewaySenderQueues];
     nextGatewaySenderToUseForRoundRobin = 0;
     dropper                  = new GatewayClientCleanupAgent(this);
     clients                  = new ConcurrentDictionary <GrainId, ClientState>();
     clientSockets            = new ConcurrentDictionary <Socket, ClientState>();
     clientsReplyRoutingCache = new ClientsReplyRoutingCache(messageCenter.MessagingConfiguration);
     this.gatewayAddress      = SiloAddress.New(gatewayAddress, 0);
     lockable                 = new object();
 }
Esempio n. 3
0
 public Gateway(MessageCenter msgCtr, NodeConfiguration nodeConfig, MessageFactory messageFactory, SerializationManager serializationManager, GlobalConfiguration globalConfig)
 {
     messageCenter             = msgCtr;
     this.messageFactory       = messageFactory;
     this.serializationManager = serializationManager;
     acceptor = new GatewayAcceptor(msgCtr, this, nodeConfig.ProxyGatewayEndpoint, this.messageFactory, this.serializationManager, globalConfig);
     senders  = new Lazy <GatewaySender> [messageCenter.MessagingConfiguration.GatewaySenderQueues];
     nextGatewaySenderToUseForRoundRobin = 0;
     dropper                  = new GatewayClientCleanupAgent(this);
     clients                  = new ConcurrentDictionary <GrainId, ClientState>();
     clientSockets            = new ConcurrentDictionary <Socket, ClientState>();
     clientsReplyRoutingCache = new ClientsReplyRoutingCache(messageCenter.MessagingConfiguration);
     this.gatewayAddress      = SiloAddress.New(nodeConfig.ProxyGatewayEndpoint, 0);
     lockable                 = new object();
 }
Esempio n. 4
0
 public Gateway(MessageCenter msgCtr, NodeConfiguration nodeConfig, MessageFactory messageFactory, SerializationManager serializationManager, GlobalConfiguration globalConfig, ILoggerFactory loggerFactory, IOptions <SiloMessagingOptions> options)
 {
     this.messagingOptions     = options.Value;
     this.loggerFactory        = loggerFactory;
     messageCenter             = msgCtr;
     this.messageFactory       = messageFactory;
     this.logger               = new LoggerWrapper <Gateway>(this.loggerFactory);
     this.serializationManager = serializationManager;
     acceptor = new GatewayAcceptor(msgCtr, this, nodeConfig.ProxyGatewayEndpoint, this.messageFactory, this.serializationManager, globalConfig, loggerFactory);
     senders  = new Lazy <GatewaySender> [messagingOptions.GatewaySenderQueues];
     nextGatewaySenderToUseForRoundRobin = 0;
     dropper                  = new GatewayClientCleanupAgent(this, loggerFactory, messagingOptions.ClientDropTimeout);
     clients                  = new ConcurrentDictionary <GrainId, ClientState>();
     clientSockets            = new ConcurrentDictionary <Socket, ClientState>();
     clientsReplyRoutingCache = new ClientsReplyRoutingCache(messagingOptions.ResponseTimeout);
     this.gatewayAddress      = SiloAddress.New(nodeConfig.ProxyGatewayEndpoint, 0);
     lockable                 = new object();
 }