예제 #1
0
 private LoopbackHost(IPlatibusConfiguration configuration)
 {
     if (configuration == null) throw new ArgumentNullException("configuration");
     _baseUri = new Uri("http://localhost");
     _bus = new Bus(configuration, _baseUri, _transportService, new InMemoryMessageQueueingService());
     _transportService = new LoopbackTransportService(_bus.HandleMessage);
 }
예제 #2
0
 public BusMessageContext(Bus bus, IMessageHeaders headers, IPrincipal senderPrincipal)
 {
     if (bus == null) throw new ArgumentNullException("bus");
     if (headers == null) throw new ArgumentNullException("headers");
     _bus = bus;
     _headers = headers;
     _senderPrincipal = senderPrincipal;
 }
예제 #3
0
        public MessageHandlingListener(Bus bus, IMessageNamingService namingService,
            ISerializationService serializationService, IEnumerable<IMessageHandler> messageHandlers)
        {
            if (bus == null) throw new ArgumentNullException("bus");
            if (namingService == null) throw new ArgumentNullException("namingService");
            if (serializationService == null) throw new ArgumentNullException("serializationService");
            if (messageHandlers == null) throw new ArgumentNullException("messageHandlers");

            var handlerList = messageHandlers.Where(h => h != null).ToList();
            if (!handlerList.Any()) throw new ArgumentNullException("messageHandlers");

            _bus = bus;
            _messageNamingService = namingService;
            _serializationService = serializationService;
            _messageHandlers = handlerList;
        }
예제 #4
0
 public BusMessageContext(Bus bus, IMessageHeaders headers, IPrincipal senderPrincipal)
 {
     _bus      = bus ?? throw new ArgumentNullException(nameof(bus));
     Headers   = headers ?? throw new ArgumentNullException(nameof(headers));
     Principal = senderPrincipal;
 }