Exemplo n.º 1
0
 public MessageRouter(ISocketFactory socketFactory,
                      IInternalRoutingTable internalRoutingTable,
                      IExternalRoutingTable externalRoutingTable,
                      IScaleOutConfigurationProvider scaleOutConfigurationProvider,
                      IClusterServices clusterServices,
                      IServiceMessageHandlerRegistry serviceMessageHandlerRegistry,
                      IPerformanceCounterManager <KinoPerformanceCounters> performanceCounterManager,
                      ISecurityProvider securityProvider,
                      ILocalSocket <IMessage> localRouterSocket,
                      ILocalReceivingSocket <InternalRouteRegistration> internalRegistrationsReceiver,
                      IInternalMessageRouteRegistrationHandler internalRegistrationHandler,
                      IRoundRobinDestinationList roundRobinDestinationList,
                      ILogger logger)
 {
     this.logger                        = logger;
     this.socketFactory                 = socketFactory;
     this.internalRoutingTable          = internalRoutingTable;
     this.externalRoutingTable          = externalRoutingTable;
     this.scaleOutConfigurationProvider = scaleOutConfigurationProvider;
     this.clusterServices               = clusterServices;
     this.serviceMessageHandlerRegistry = serviceMessageHandlerRegistry;
     this.performanceCounterManager     = performanceCounterManager;
     this.securityProvider              = securityProvider;
     this.localRouterSocket             = localRouterSocket;
     this.localRouterSocket.SendRate    = performanceCounterManager.GetCounter(KinoPerformanceCounters.MessageRouterLocalSocketSendRate);
     this.localRouterSocket.ReceiveRate = performanceCounterManager.GetCounter(KinoPerformanceCounters.MessageRouterLocalSocketReceiveRate);
     this.internalRegistrationsReceiver = internalRegistrationsReceiver;
     this.internalRegistrationHandler   = internalRegistrationHandler;
     this.roundRobinDestinationList     = roundRobinDestinationList;
 }
Exemplo n.º 2
0
 public ActorHost(IInternalRegistrationService internalRegistrationService,
                  IActorHandlerMap actorHandlerMap,
                  ILocalSocketFactory localSocketFactory,
                  IMessageRouter messageRouter,
                  ISecurityProvider securityProvider)
 {
     this.internalRegistrationService = internalRegistrationService;
     this.actorHandlerMap             = actorHandlerMap;
     this.messageRouter    = messageRouter;
     this.securityProvider = securityProvider;
     socket = localSocketFactory.Create(DispatchMessage);
 }
Exemplo n.º 3
0
 public ActorHostFactory(ISecurityProvider securityProvider,
                         ILocalSocket <IMessage> localRouterSocket,
                         ILocalSendingSocket <InternalRouteRegistration> internalRegistrationsSender,
                         ILocalSocketFactory localSocketFactory,
                         ILogger logger)
 {
     this.securityProvider            = securityProvider;
     this.localRouterSocket           = localRouterSocket;
     this.internalRegistrationsSender = internalRegistrationsSender;
     this.localSocketFactory          = localSocketFactory;
     this.logger = logger;
 }
Exemplo n.º 4
0
 public MessageHub(IInternalRegistrationService internalRegistrationService,
                   ILocalSocketFactory localSocketFactory,
                   IMessageRouter messageRouter,
                   ISecurityProvider securityProvider,
                   ICallbackHandlerStack callbackHandlers)
 {
     ReceiverIdentifier = ReceiverIdentifier.Create(ReceiverKind.MessageHub);
     this.internalRegistrationService = internalRegistrationService;
     this.messageRouter    = messageRouter;
     this.securityProvider = securityProvider;
     this.callbackHandlers = callbackHandlers;
     socket = localSocketFactory.Create(DispatchMessage);
 }
Exemplo n.º 5
0
        public bool Equals(ILocalSocket <T> other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(GetIdentity() == other.GetIdentity());
        }
Exemplo n.º 6
0
 public ClusterHealthMonitor(ISocketFactory socketFactory,
                             ILocalSocketFactory localSocketFactory,
                             ISecurityProvider securityProvider,
                             ILocalSendingSocket <IMessage> routerLocalSocket,
                             IConnectedPeerRegistry connectedPeerRegistry,
                             ClusterHealthMonitorConfiguration config,
                             ILogger logger)
 {
     deadPeersCheckInterval     = TimeSpan.FromDays(1);
     this.socketFactory         = socketFactory;
     this.securityProvider      = securityProvider;
     multiplexingSocket         = localSocketFactory.Create <IMessage>();
     this.config                = config;
     this.routerLocalSocket     = routerLocalSocket;
     this.connectedPeerRegistry = connectedPeerRegistry;
     this.logger                = logger;
 }
Exemplo n.º 7
0
 public AutoDiscoveryListener(IRendezvousCluster rendezvousCluster,
                              ISocketFactory socketFactory,
                              IScaleOutConfigurationProvider scaleOutConfigurationProvider,
                              ClusterMembershipConfiguration membershipConfiguration,
                              IPerformanceCounterManager <KinoPerformanceCounters> performanceCounterManager,
                              ILocalSocket <IMessage> localRouterSocket,
                              ILogger logger)
 {
     this.logger = logger;
     this.membershipConfiguration       = membershipConfiguration;
     this.performanceCounterManager     = performanceCounterManager;
     this.localRouterSocket             = localRouterSocket;
     this.rendezvousCluster             = rendezvousCluster;
     this.socketFactory                 = socketFactory;
     this.scaleOutConfigurationProvider = scaleOutConfigurationProvider;
     heartBeatReceived          = new ManualResetEvent(false);
     newRendezvousConfiguration = new ManualResetEvent(false);
 }
Exemplo n.º 8
0
 public ActorHost(IActorHandlerMap actorHandlerMap,
                  IAsyncQueue <AsyncMessageContext> asyncQueue,
                  IAsyncQueue <ActorRegistration> actorRegistrationsQueue,
                  ISecurityProvider securityProvider,
                  ILocalSocket <IMessage> localRouterSocket,
                  ILocalSendingSocket <InternalRouteRegistration> internalRegistrationsSender,
                  ILocalSocketFactory localSocketFactory,
                  ILogger logger)
 {
     this.logger                      = logger;
     this.actorHandlerMap             = actorHandlerMap;
     this.securityProvider            = securityProvider;
     this.localRouterSocket           = localRouterSocket;
     this.internalRegistrationsSender = internalRegistrationsSender;
     this.asyncQueue                  = asyncQueue;
     this.actorRegistrationsQueue     = actorRegistrationsQueue;
     receivingSocket                  = localSocketFactory.Create <IMessage>();
 }
Exemplo n.º 9
0
 public MessageHub(ICallbackHandlerStack callbackHandlers,
                   ILocalSocket <IMessage> localRouterSocket,
                   ILocalSendingSocket <InternalRouteRegistration> internalRegistrationsSender,
                   ILocalSocketFactory localSocketFactory,
                   IScaleOutConfigurationProvider scaleOutConfigurationProvider,
                   ISecurityProvider securityProvider,
                   ILogger logger,
                   bool keepRegistrationLocal = false)
 {
     this.logger                        = logger;
     this.localRouterSocket             = localRouterSocket;
     this.internalRegistrationsSender   = internalRegistrationsSender;
     this.scaleOutConfigurationProvider = scaleOutConfigurationProvider;
     this.securityProvider              = securityProvider;
     this.keepRegistrationLocal         = keepRegistrationLocal;
     this.callbackHandlers              = callbackHandlers;
     registrationsQueue                 = new BlockingCollection <CallbackRegistration>(new ConcurrentQueue <CallbackRegistration>());
     receivingSocket                    = localSocketFactory.Create <IMessage>();
     ReceiverIdentifier                 = ReceiverIdentities.CreateForMessageHub();
 }