void ConfigureUsingDecoratedConnection(ChannelConfiguratorConnection <TChannel> connection)
        {
            var synchronizedConnection = new SynchronizedChannelConfiguratorConnection(connection, _synchronizationContext,
                                                                                       _state);

            _configurator.Configure(synchronizedConnection);
        }
示例#2
0
 public DistinctChannelConfiguratorConnection(ChannelConfiguratorConnection <ICollection <TChannel> > connection,
                                              Fiber fiber, KeyAccessor <TChannel, TKey> keyAccessor)
 {
     _connection  = connection;
     _fiber       = fiber;
     _keyAccessor = keyAccessor;
 }
示例#3
0
        public void Configure(ChannelConfiguratorConnection <TChannel> connection)
        {
            Fiber fiber = GetConfiguredFiber(connection);

            _configurator.Configure(new IntervalChannelConfiguratorConnection(connection, fiber, _schedulerFactory(),
                                                                              _interval));
        }
 public SynchronizedChannelConfiguratorConnection(ChannelConfiguratorConnection <TChannel> connection,
                                                  SynchronizationContext synchronizationContext, object state)
 {
     _connection             = connection;
     _synchronizationContext = synchronizationContext;
     _state = state;
 }
 public ChannelConfiguratorConnectionDecorator(ChannelConfiguratorConnection <TChannel> connection, Fiber fiber,
                                               Filter <TChannel> filter)
 {
     _connection = connection;
     _fiber      = fiber;
     _filter     = filter;
 }
示例#6
0
        protected Fiber GetConfiguredFiber <TChannel>(ChannelConfiguratorConnection <TChannel> connection)
        {
            Fiber fiber = _fiberFactory();

            connection.AddDisposable(fiber.GetShutdownDisposable(_shutdownTimeout));

            return(fiber);
        }
        public void Configure(ChannelConfiguratorConnection <TChannel> connection)
        {
            Fiber fiber = GetConfiguredFiber(connection);

            var filterConnection = new ChannelConfiguratorConnectionDecorator(connection, fiber, _filter);

            _configurator.Configure(filterConnection);
        }
示例#8
0
        public void Configure(ChannelConfiguratorConnection connection)
        {
            Fiber fiber = GetConfiguredFiber(connection);

            var host = new WcfChannelHost(fiber, connection.Channel, _endpointUri, _pipeName);

            connection.AddDisposable(host);
        }
        public void Configure(ChannelConfiguratorConnection connection)
        {
            Fiber fiber = GetConfiguredFiber(connection);

            foreach (var result in _results)
            {
                result.Connect(connection, fiber, _instance);
            }
        }
示例#10
0
 public IntervalChannelConfiguratorConnection(ChannelConfiguratorConnection <TChannel> connection,
                                              Fiber fiber,
                                              Scheduler scheduler,
                                              TimeSpan interval)
 {
     _connection = connection;
     _fiber      = fiber;
     _scheduler  = scheduler;
     _interval   = interval;
 }
 public void Configure(ChannelConfiguratorConnection <TChannel> connection)
 {
     if (_synchronizationContext == null)
     {
         _configurator.Configure(connection);
     }
     else
     {
         ConfigureUsingDecoratedConnection(connection);
     }
 }
        public ChannelProvider <TChannel> GetChannelProvider(ChannelConfiguratorConnection <TChannel> connection)
        {
            if (_accessor == null)
            {
                throw new ChannelConfigurationException(typeof(TChannel),
                                                        "No channel accessor was specified for instance: "
                                                        + typeof(TInstance).ToShortTypeName());
            }

            return(new InstanceChannelProvider <TInstance, TChannel>(_instanceProvider(), _accessor));
        }
        public ChannelProvider <TChannel> GetChannelProvider(ChannelConfiguratorConnection <TChannel> connection)
        {
            if (_providerFactory == null)
            {
                throw new ChannelConfigurationException(typeof(TChannel), "No instance provider was specified in the configuration");
            }

            ChannelProvider <TChannel> provider = _providerFactory(connection);

            var keyedProvider = new KeyedChannelProvider <TChannel, TKey>(provider, _keyAccessor);

            return(keyedProvider);
        }
        protected FiberProvider <TKey> GetConfiguredProvider <TChannel>(ChannelConfiguratorConnection <TChannel> connection)
        {
            if (_configuredProvider == null)
            {
                throw new FiberConfigurationException("No provider specified for FiberProvider");
            }

            FiberProvider <TKey> configuredProvider = _configuredProvider();

            connection.AddDisposable(configuredProvider);

            return(configuredProvider);
        }
示例#15
0
        public ChannelProvider <TChannel> GetChannelProvider(ChannelConfiguratorConnection <TChannel> connection)
        {
            if (_accessor == null)
            {
                throw new ChannelConfigurationException(typeof(TChannel),
                                                        "No channel accessor was specified for NHibernate instance: "
                                                        + typeof(TInstance).ToShortTypeName());
            }
            if (_keyAccessor == null)
            {
                throw new ChannelConfigurationException(typeof(TChannel),
                                                        "No message key accessor was specified for NHibernate instance: "
                                                        + typeof(TInstance).ToShortTypeName());
            }
            if (_instanceChannelPolicy == null)
            {
                throw new ChannelConfigurationException(typeof(TChannel),
                                                        "No missing instance provider specified for NHibernate instance: "
                                                        + typeof(TInstance).ToShortTypeName());
            }
            if (_sessionProvider == null)
            {
                throw new ChannelConfigurationException(typeof(TChannel),
                                                        "No NHibernate ISession provider specified for NHibernate instance: "
                                                        + typeof(TInstance).ToShortTypeName());
            }

            FiberProvider <TKey> fiberProvider = _configurator.GetConfiguredProvider(connection);

            var channelProvider = new NHibernateInstanceChannelProvider <TInstance, TChannel, TKey>(fiberProvider,
                                                                                                    _sessionProvider,
                                                                                                    _keyAccessor,
                                                                                                    _accessor,
                                                                                                    _instanceChannelPolicy());

            return(channelProvider);
        }
示例#16
0
 public void Configure(ChannelConfiguratorConnection connection)
 {
     connection.AddChannel(null, fiber => _channel);
 }
示例#17
0
 public void Configure(ChannelConfiguratorConnection connection)
 {
     connection.AddChannel(null, fiber => _channel);
 }
 public FiberProvider <TKey> GetConfiguredProvider(ChannelConfiguratorConnection <TChannel> connection)
 {
     return(base.GetConfiguredProvider(connection));
 }
示例#19
0
        public void Configure(ChannelConfiguratorConnection connection)
        {
            Fiber fiber = GetConfiguredFiber(connection);

            _propertyBinders.Each(x => x(connection, fiber, _instance));
        }
        public void Configure(ChannelConfiguratorConnection connection)
        {
            Fiber fiber = GetConfiguredFiber(connection);

            connection.AddChannel(fiber, x => new WcfChannelProxy(x, _endpointUri, _pipeName));
        }
示例#21
0
        public void Configure(ChannelConfiguratorConnection <ICollection <TChannel> > connection)
        {
            Fiber fiber = GetConfiguredFiber(connection);

            _configurator.Configure(new DistinctChannelConfiguratorConnection(connection, fiber, _keyAccessor));
        }
 public void Configure(ChannelConfiguratorConnection connection)
 {
     _configurator.Configure(new ChannelConfiguratorConnectionDecorator(connection));
 }
 public LastChannelConfiguratorConnection(ChannelConfiguratorConnection <ICollection <TChannel> > connection,
                                          Fiber fiber)
 {
     _connection = connection;
     _fiber      = fiber;
 }
 public ChannelConfiguratorConnectionDecorator(ChannelConfiguratorConnection connection)
 {
     _connection = connection;
 }
示例#25
0
 public void Configure(ChannelConfiguratorConnection <TChannel> connection)
 {
     _configurator.Configure(connection);
 }
示例#26
0
        public void Configure(ChannelConfiguratorConnection <TChannel> connection)
        {
            Fiber fiber = GetConfiguredFiber(connection);

            connection.AddChannel(fiber, x => new SelectiveConsumerChannel <TChannel>(x, _consumer));
        }
        public void Configure(ChannelConfiguratorConnection <ICollection <TChannel> > connection)
        {
            Fiber fiber = GetConfiguredFiber(connection);

            _configurator.Configure(new LastChannelConfiguratorConnection(connection, fiber));
        }