public JasonDelegatingHandler(String correlationIdHeader, IJasonServerConfiguration configuration, Func <HttpRequestMessage, Object, HttpResponseMessage> defaultExecutor, HttpConfiguration httpConfiguration) { this.correlationIdHeader = correlationIdHeader; this.configuration = configuration; this.defaultExecutor = defaultExecutor; this.httpConfiguration = httpConfiguration; }
public JasonDelegatingHandler( String correlationIdHeader, IJasonServerConfiguration configuration, Func<HttpRequestMessage, Object, HttpResponseMessage> defaultExecutor, HttpConfiguration httpConfiguration ) { this.correlationIdHeader = correlationIdHeader; this.configuration = configuration; this.defaultExecutor = defaultExecutor; this.httpConfiguration = httpConfiguration; }
public WebApiCommandDispatcher(ICommandExecutionRetryPolicy retryPolicy, ICommandHandlerProvider handlerProvider, IInterceptorProvider interceptorProvider, IValidatorsProvider validatorsProvider, IJasonServerConfiguration configuration) { this.handlerProvider = handlerProvider; this.retryPolicy = retryPolicy; this.interceptorProvider = interceptorProvider; this.validatorsProvider = validatorsProvider; this.configuration = configuration; logger.Debug("WebApiCommandDispatcher.ctor"); }
public WebApiCommandDispatcher( ICommandExecutionRetryPolicy retryPolicy, ICommandHandlerProvider handlerProvider, IInterceptorProvider interceptorProvider, IValidatorsProvider validatorsProvider, IJasonServerConfiguration configuration ) { this.handlerProvider = handlerProvider; this.retryPolicy = retryPolicy; this.interceptorProvider = interceptorProvider; this.validatorsProvider = validatorsProvider; this.configuration = configuration; logger.Debug( "WebApiCommandDispatcher.ctor" ); }
public void Initialize( IJasonServerConfiguration configuration, IEnumerable<Type> types ) { configuration.Container.RegisterAsTransient( new[] { typeof( IWorkerService ) }, this.WorkerServiceType ); types.Where( t => { return ( !t.IsGenericType && t.IsAttributeDefined<Jason.Configuration.ServiceKnownTypeAttribute>( true ) ) || this.CommandsSelector( t ); } ) .ForEach( t => ServiceKnownTypesProvider.RegisterKnownType( t ) ); if ( this.EnableSelfHosting ) { this.host = new BasicDependencyInjectionServiceHost( configuration.Container, this.WorkerServiceType ); this.host.Open(); } }
public void Initialize(IJasonServerConfiguration configuration, IEnumerable <Type> types) { configuration.Container.RegisterAsTransient(new[] { typeof(IWorkerService) }, this.WorkerServiceType); types.Where(t => { return((!t.IsGenericType && t.IsAttributeDefined <Jason.Configuration.ServiceKnownTypeAttribute>(true)) || this.CommandsSelector(t)); }) .ForEach(t => ServiceKnownTypesProvider.RegisterKnownType(t)); if (this.EnableSelfHosting) { this.host = new BasicDependencyInjectionServiceHost(configuration.Container, this.WorkerServiceType); this.host.Open(); } }
public void Initialize(IJasonServerConfiguration configuration, IEnumerable <Type> types) { //configuration.Container.RegisterAsTransient( new[] { typeof( JasonController ) }, typeof( JasonController ) ); configuration.Container.RegisterAsTransient(new[] { typeof(IWebApiRequestExecutor) }, typeof(WebApiRequestExecutor)); configuration.Container.RegisterAsTransient(new[] { typeof(IWebApiCommandDispatcher) }, typeof(WebApiCommandDispatcher)); configuration.Container.RegisterAsTransient(new[] { typeof(IWebApiJobDispatcher) }, typeof(WebApiJobDispatcher)); Func <HttpRequestMessage, Object, HttpResponseMessage> defaultExecutor = (request, cmd) => { var executor = configuration.Container.Resolve <IWebApiRequestExecutor>(); var result = executor.Handle(request, cmd); return(result); }; this.httpConfiguration.MessageHandlers.Add(new JasonDelegatingHandler(this.CorrelationIdHeaderName, configuration, defaultExecutor, this.httpConfiguration)); var allCommands = types.Where(this.IsCommandConvention); foreach (var cmdType in allCommands) { this.mapper.CreateMapping(cmdType); } if (this.TypeNameHandling.HasValue) { this.httpConfiguration .Formatters .JsonFormatter .SerializerSettings .TypeNameHandling = this.TypeNameHandling.Value; } if (!this.httpConfiguration.Filters.OfType <JasonWebApiActionFilter>().Any()) { var filter = new JasonWebApiActionFilter(this.CorrelationIdHeaderName, configuration, defaultExecutor); this.httpConfiguration.Filters.Add(filter); } }
public WebApiRequestExecutor(IJasonServerConfiguration configuration, IWebApiCommandDispatcher commandDispatcher, IWebApiJobDispatcher jobDispatcher) { this.configuration = configuration; this.commandDispatcher = commandDispatcher; this.jobDispatcher = jobDispatcher; }
public void Initialize( IJasonServerConfiguration configuration, IEnumerable<Type> types ) { configuration.Container.RegisterAsTransient( new[] { typeof( IWorkerServiceClientFactory ) }, typeof( DefaultWorkerServiceClientFactory ) ); }
public void Initialize(IJasonServerConfiguration configuration, IEnumerable <Type> types) { configuration.Container.RegisterAsTransient(new[] { typeof(IWorkerServiceClientFactory) }, typeof(DefaultWorkerServiceClientFactory)); }
public DefaultValidatorsProvider(IJasonDependencyResolver container, IJasonServerConfiguration configuration) { this.container = container; this.configuration = configuration; }
public DefaultValidatorsProvider( IJasonDependencyResolver container, IJasonServerConfiguration configuration ) { this.container = container; this.configuration = configuration; }
public JasonWebApiActionFilter(String correlationIdHeader, IJasonServerConfiguration configuration, Func <HttpRequestMessage, Object, HttpResponseMessage> defaultExecutor) { this.correlationIdHeader = correlationIdHeader; this.configuration = configuration; this.defaultExecutor = defaultExecutor; }
public WebApiRequestExecutor( IJasonServerConfiguration configuration, IWebApiCommandDispatcher commandDispatcher, IWebApiJobDispatcher jobDispatcher ) { this.configuration = configuration; this.commandDispatcher = commandDispatcher; this.jobDispatcher = jobDispatcher; }
public DefaultCommandHandleProvider( IJasonDependencyResolver container, IJasonServerConfiguration configuration ) { this.container = container; this.configuration = configuration; }
public void Initialize( IJasonServerConfiguration configuration, IEnumerable<Type> types ) { //configuration.Container.RegisterAsTransient( new[] { typeof( JasonController ) }, typeof( JasonController ) ); configuration.Container.RegisterAsTransient( new[] { typeof( IWebApiRequestExecutor ) }, typeof( WebApiRequestExecutor ) ); configuration.Container.RegisterAsTransient( new[] { typeof( IWebApiCommandDispatcher ) }, typeof( WebApiCommandDispatcher ) ); configuration.Container.RegisterAsTransient( new[] { typeof( IWebApiJobDispatcher ) }, typeof( WebApiJobDispatcher ) ); Func<HttpRequestMessage, Object, HttpResponseMessage> defaultExecutor = ( request, cmd ) => { var executor = configuration.Container.Resolve<IWebApiRequestExecutor>(); var result = executor.Handle( request, cmd ); return result; }; this.httpConfiguration.MessageHandlers.Add( new JasonDelegatingHandler( this.CorrelationIdHeaderName, configuration, defaultExecutor, this.httpConfiguration ) ); var allCommands = types.Where( this.IsCommandConvention ); foreach( var cmdType in allCommands ) { this.mapper.CreateMapping( cmdType ); } if( this.TypeNameHandling.HasValue ) { this.httpConfiguration .Formatters .JsonFormatter .SerializerSettings .TypeNameHandling = this.TypeNameHandling.Value; } if( !this.httpConfiguration.Filters.OfType<JasonWebApiActionFilter>().Any() ) { var filter = new JasonWebApiActionFilter( this.CorrelationIdHeaderName, configuration, defaultExecutor ); this.httpConfiguration.Filters.Add( filter ); } }
public JasonWebApiActionFilter( String correlationIdHeader, IJasonServerConfiguration configuration, Func<HttpRequestMessage, Object, HttpResponseMessage> defaultExecutor ) { this.correlationIdHeader = correlationIdHeader; this.configuration = configuration; this.defaultExecutor = defaultExecutor; }
public DefaultCommandHandleProvider(IJasonDependencyResolver container, IJasonServerConfiguration configuration) { this.container = container; this.configuration = configuration; }