Exemple #1
0
        public RegisterEndpointHandler(IDatabaseContextFactory databaseContextFactory, IEndpointQuery endpointQuery,
                                       ISentinelConfiguration configuration)
        {
            Guard.AgainstNull(databaseContextFactory, nameof(databaseContextFactory));
            Guard.AgainstNull(endpointQuery, nameof(endpointQuery));
            Guard.AgainstNull(configuration, nameof(configuration));

            _databaseContextFactory = databaseContextFactory;
            _endpointQuery          = endpointQuery;
            _configuration          = configuration;
        }
        public static void RegisterConfiguration(this IWindsorContainer container, ISentinelConfiguration configuration)
        {
            Guard.AgainstNull(container, "container");
            Guard.AgainstNull(configuration, "configuration");

            container.Register(Component.For <ISentinelConfiguration>().Instance(configuration));
            container.Register(Component.For <IAuthenticationService>().ImplementedBy(configuration.AuthenticationServiceType));
            container.Register(Component.For <IAuthorizationService>().ImplementedBy(configuration.AuthorizationServiceType));

            container.Resolve <IConfiguredDatabaseContextFactory>().ConfigureWith(configuration.ProviderName, configuration.ConnectionString);
        }
Exemple #3
0
        public EndpointsController(IServiceBus bus, IDatabaseContextFactory databaseContextFactory,
                                   IEndpointQuery endpointQuery, ISentinelConfiguration configuration)
        {
            Guard.AgainstNull(databaseContextFactory, nameof(databaseContextFactory));
            Guard.AgainstNull(endpointQuery, nameof(endpointQuery));
            Guard.AgainstNull(bus, nameof(bus));
            Guard.AgainstNull(configuration, nameof(configuration));

            _databaseContextFactory = databaseContextFactory;
            _endpointQuery          = endpointQuery;
            _configuration          = configuration;
            _bus = bus;
        }
        public SentinelModule(IServiceBus bus, IMessageRouteProvider messageRoutePrvider,
                              IPipelineFactory pipelineFactory, IEndpointAggregator endpointAggregator,
                              ISentinelObserver sentinelObserver, ISentinelConfiguration sentinelConfiguration)
        {
            Guard.AgainstNull(bus, nameof(bus));
            Guard.AgainstNull(messageRoutePrvider, nameof(messageRoutePrvider));
            Guard.AgainstNull(pipelineFactory, nameof(pipelineFactory));
            Guard.AgainstNull(endpointAggregator, nameof(endpointAggregator));
            Guard.AgainstNull(sentinelObserver, nameof(sentinelObserver));
            Guard.AgainstNull(sentinelConfiguration, nameof(sentinelConfiguration));

            _bus = bus;
            _messageRoutePrvider   = messageRoutePrvider;
            _endpointAggregator    = endpointAggregator;
            _sentinelObserver      = sentinelObserver;
            _sentinelConfiguration = sentinelConfiguration;

            pipelineFactory.PipelineCreated += PipelineCreated;
        }