public static void Register(TransportEndpointAddress transportEndpointAddress, ITransport transport)
        {
            if (transport == null)
                return;

            _map[transportEndpointAddress.GetFriendlyName()] = transport;
        }
        public static ITransport GetQueueProvider(TransportEndpointAddress transportEndpointAddress)
        {
            ITransport provider;
            if (!_map.TryGetValue(transportEndpointAddress.GetFriendlyName(), out provider))
                return null;

            return provider;
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:System.Object"/> class.
        /// </summary>
        public ServiceBus(ServiceBusConfiguration configuration)
        {
            if (configuration.ServiceLocator == null)
                throw new ArgumentException("Service Locator doesn't registered. Use SetServiceLocator() method.");

            if (configuration.InputQueue == null)
                throw new ArgumentException("Input queue not configured. Use SetInputQueue() method.");

            _configuration = configuration;
            _provider = configuration.Transport;
            _inputTransportEndpointAddress = configuration.InputQueue;
            _errorTransportEndpointAddress = configuration.ErrorQueue;
            _endpointMapping = configuration.EndpointsMapping;

            // use container of ServiceBus, if not specified for dispatcher
            if (_configuration.DispatcherConfiguration.ServiceLocator == null)
                _configuration.DispatcherConfiguration.ServiceLocator = configuration.ServiceLocator;

            TransportRegistry.Register(_inputTransportEndpointAddress, _provider);
            TransportRegistry.Register(_errorTransportEndpointAddress, _provider);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public SingleThreadTransportEndpointObserver(ITransport transport, TransportEndpointAddress transportEndpointAddress, String threadName = null)
 {
     _transport = transport;
     _transportEndpointAddress = transportEndpointAddress;
     _threadName = threadName;
 }