Exemplo n.º 1
0
 public TransportSetup(IRequestRouter requestRouter, IReceiverCache receiverCache, ITopicRouter topicRouter, IPublisherCache publisherCache)
 {
     this.topicRouter    = topicRouter ?? throw new ArgumentNullException(nameof(topicRouter));
     this.receiverCache  = receiverCache ?? throw new ArgumentNullException(nameof(receiverCache));
     this.requestRouter  = requestRouter ?? throw new ArgumentNullException(nameof(requestRouter));
     this.publisherCache = publisherCache ?? throw new ArgumentNullException(nameof(publisherCache));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of <see cref="IPublisherCache"/>
        /// </summary>
        /// <param name="name">A name that can be used to identify the router as a node on a distributed network</param>
        /// <param name="senderCache"></param>
        /// <param name="monitorCache"></param>
        /// <param name="receiverCache"></param>
        /// <param name="publisherCache"></param>
        /// <param name="subscriberCache"></param>
        public Router(
            string name,
            ISenderCache senderCache,
            IMonitorCache monitorCache,
            IReceiverCache receiverCache,
            IPublisherCache publisherCache,
            ISubscriberCache subscriberCache)
        {
            if (String.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            this.senderCache     = senderCache ?? throw new ArgumentNullException(nameof(senderCache));
            this.monitorCache    = monitorCache ?? throw new ArgumentNullException(nameof(monitorCache));
            this.receiverCache   = receiverCache ?? throw new ArgumentNullException(nameof(receiverCache));
            this.publisherCache  = publisherCache ?? throw new ArgumentNullException(nameof(publisherCache));
            this.subscriberCache = subscriberCache ?? throw new ArgumentNullException(nameof(subscriberCache));

            routerInfo = new RouterInfo
            {
                Name             = name,
                Running          = false,
                StartedTimestamp = null,
                StoppedTimestamp = null
            };
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of <see cref="NetMQTransport"/>
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="requestRouter"></param>
 /// <param name="receiverCache"></param>
 /// <param name="topicRouter"></param>
 /// <param name="publisherCache"></param>
 /// <returns></returns>
 public static NetMQTransport Create(
     INetMQFactory factory,
     IRequestRouter requestRouter,
     IReceiverCache receiverCache,
     ITopicRouter topicRouter,
     IPublisherCache publisherCache
     )
 => new NetMQTransport(factory, requestRouter, receiverCache, topicRouter, publisherCache);
Exemplo n.º 4
0
 public void Setup()
 {
     senderCache     = mockSenderCache.Object;
     monitorCache    = mockMonitorCache.Object;
     receiverCache   = mockReceiverCache.Object;
     publisherCache  = mockPublisherCache.Object;
     subscriberCache = mockSubscriberCache.Object;
 }
Exemplo n.º 5
0
 public void Setup()
 {
     factory        = mockFactory.Object;
     requestRouter  = mockRequestRouter.Object;
     topicRouter    = mockTopicRouter.Object;
     receiverCache  = mockReceiverCache.Object;
     publisherCache = mockPublisherCache.Object;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of <see cref="NetMQTransport"/>
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="requestRouter"></param>
 /// <param name="receiverCache"></param>
 /// <param name="topicRouter"></param>
 /// <param name="publisherCache"></param>
 private NetMQTransport(
     INetMQFactory factory,
     IRequestRouter requestRouter,
     IReceiverCache receiverCache,
     ITopicRouter topicRouter,
     IPublisherCache publisherCache)
 {
     this.factory = factory ?? throw new ArgumentNullException(nameof(factory));
     Configurer   = new TransportSetup <INetMQSender, INetMQReceiver, INetMQPublisher, INetMQSubscriber>(requestRouter, receiverCache, topicRouter, publisherCache);
 }