public static void ContributeLifecycleListener <TComponent>(this IComponentContainerBuilder containerBuilder) where TComponent : ILifecycleListenerComponent { containerBuilder.RegisterComponentType <TComponent>() .SingleInstance() .ForService <ILifecycleListenerComponent>(); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public void ContributeComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { foreach (var feature in _containedFeatures) { feature.ContributeComponents(existingComponents, newComponents); } }
public override void ContributeConfigSections(IComponentContainerBuilder newComponents) { if (_s_featureLoaderMocks.TryGetValue(this.GetType(), out FeatureLoaderMock mock)) { mock.ContributeConfigSections(newComponents); } }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public void ContributeConfigSections(IComponentContainerBuilder newComponents) { foreach (var feature in _containedFeatures) { feature.ContributeConfigSections(newComponents); } }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public static void ContributeMessageProtocol <TProtocol>(this IComponentContainerBuilder containerBuilder) where TProtocol : MessageProtocol { containerBuilder.RegisterComponentType <TProtocol>() .SingleInstance() .ForService <MessageProtocol>(); }
public override void ContributeConfigSections(IComponentContainerBuilder newComponents) { base.ContributeConfigSections(newComponents); newComponents .RegisterComponentInstance(new ConfigSection_MessagingPlatformConfiguration()) .ForService <IMessagingPlatformConfiguration>(); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public static void ContributePortBExample(this IComponentContainerBuilder containerBuilder, string value) { containerBuilder.RegisterComponentInstance <PortsAndAdaptersPoc.ExamplePortB>( new PortsAndAdaptersPoc.ExamplePortB(containerBuilder) { Value = value } ); }
public HttpEndpointInjectorPort( IComponentContainerBuilder containerBuilder, string name, Action <IHttpEndpointConfig> onConfiguration, Func <HttpContext, Task> onRequest) : base(containerBuilder) { this.Name = name; this.OnConfiguration = onConfiguration; this.OnRequest = onRequest; }
//----------------------------------------------------------------------------------------------------------------------------------------------------- private void ContributeCompiledTxHandlers(IComponentContainer input, IComponentContainerBuilder output) { //var handlerObjectFactory = input.Resolve<ITxResourceHandlerObjectFactory>(); //foreach (var txType in _allTxTypes) //{ // var handlerList = handlerObjectFactory.CreateResourceHandlerList(txType); // foreach (var handlerType in handlerList.GetHandlerTypes()) // { // output.RegisterComponentType(handlerType).ForService<IRestResourceHandler>(); // } //} }
public static HttpEndpointInjectorPort ContributeHttpEndpoint( this IComponentContainerBuilder containerBuilder, string name, int?listenPortNumber = null, Action <IHttpEndpointConfig> onConfiguration = null, Func <HttpContext, Task> onRequest = null) { if (listenPortNumber.HasValue) { onConfiguration += (http) => { http.Port = listenPortNumber.Value; }; } var port = new HttpEndpointInjectorPort(containerBuilder, name, onConfiguration, onRequest); containerBuilder.RegisterComponentInstance <HttpEndpointInjectorPort>(port); return(port); }
//------------------------------------------------------------------------------------------------------------------------------------------------- public override void ContributeCompiledComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { OnContributeCompiledComponents?.Invoke(_featureLoaderType, existingComponents, newComponents); }
//------------------------------------------------------------------------------------------------------------------------------------------------- public override void ContributeConfigSections(IComponentContainerBuilder newComponents) { OnContributeConfigSections?.Invoke(_featureLoaderType, newComponents); }
public static IComponentRegistrationBuilder ContributeTransactionScript <TComponent>(this IComponentContainerBuilder containerBuilder) where TComponent : class { return(containerBuilder.RegisterComponentType <TComponent>().InstancePerDependency()); }
public override void ContributeComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { newComponents.RegisterComponentType <TypeLibrary <IRuntimeTypeFactoryArtifact> >() .SingleInstance() .ForService <ITypeLibrary <IRuntimeTypeFactoryArtifact> >(); newComponents.RegisterComponentType <VoidTypeFactoryBackend>() .SingleInstance() .ForService <ITypeLibrary <IRuntimeTypeFactoryArtifact> >() .AsFallback(); }
public static void ContributeTypeFactory <TTypeFactory, TObjectFactory>(this IComponentContainerBuilder containerBuilder) where TTypeFactory : class, TObjectFactory, ITypeFactory { containerBuilder.RegisterComponentType <TTypeFactory>().SingleInstance().ForService <TObjectFactory>(); }
protected AbstractUIAppInjectorPort(IComponentContainerBuilder containerBuilder, Type appComponentType) : base(containerBuilder) { this.AppComponentType = appComponentType; }
public override void ContributeCompiledComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { newComponents.RegisterComponentType <CompileRegistered>().ForService <ICompileRegistered>(); base.ContributeCompiledComponents(existingComponents, newComponents); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- private void OnRegisterHostComponents(IComponentContainerBuilder containerBuilder) { containerBuilder.RegisterComponentInstance <MicroserviceHostBuilder>(this); }
public override void ContributeComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { newComponents.RegisterComponentType <RoslynTypeFactoryBackend>() .SingleInstance() .ForService <ITypeFactoryBackend <IRuntimeTypeFactoryArtifact> >(); //containerBuilder.Register<ITypeFactoryBackend<IRuntimeTypeFactoryArtifact>, RoslynTypeFactoryBackend>(LifeStyle.Singleton); }
public override void ContributeComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { base.ContributeComponents(existingComponents, newComponents); newComponents.RegisterComponentType <DefaultInvocationScheduler>() .SingleInstance() .ForService <IInvocationScheduler>() .AsFallback(); }
public virtual void ContributeConfigSections(IComponentContainerBuilder newComponents) { }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public virtual void ContributeCompiledComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { }
public override void ContributeComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { base.ContributeComponents(existingComponents, newComponents); newComponents.RegisterComponentType <RestApiService>() .SingleInstance() .ForService <IRestApiService>(); }
public override void ContributeAdapterComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { base.ContributeCompiledComponents(existingComponents, newComponents); var allPorts = existingComponents.ResolveAll <HttpEndpointInjectorPort>(); foreach (var port in allPorts) { port.ConfigureHttpEndpoint(existingComponents); newComponents.RegisterComponentType <KestrelHttpEndpoint>() .WithParameter <HttpEndpointInjectorPort>(port) .SingleInstance() .ForServices <IEndpoint, ILifecycleListenerComponent>(); } }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public override void ContributeCompiledComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { if (_s_featureLoaderMocks.TryGetValue(this.GetType(), out FeatureLoaderMock mock)) { mock.ContributeCompiledComponents(existingComponents, newComponents); } }
//----------------------------------------------------------------------------------------------------------------------------------------------------- internal void ApplyComponentContributions(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { foreach (var contributor in _componentContributions) { contributor(existingComponents, newComponents); } }
public WebAppInjectorPort(IComponentContainerBuilder containerBuilder, Type appComponentType, string uriPathBase) : base(containerBuilder, appComponentType) { this.UriPathBase = uriPathBase; }
//------------------------------------------------------------------------------------------------------------------------------------------------- public override void ContributeCompiledComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { base.ContributeCompiledComponents(existingComponents, newComponents); var handlerList1 = new TxResourceHandlerList_of_HelloWorldTx(); // this instantation will be handled by TxResourceHandlerTypeFactory foreach (var handlerType in handlerList1.GetHandlerTypes()) { newComponents.RegisterComponentType(handlerType).ForService <IResourceHandler>(); } }
//----------------------------------------------------------------------------------------------------------------------------------------------------- private void RegisterHostComponents(IComponentContainerBuilder containerBuilder) { _hostComponents?.Invoke(containerBuilder); }
public override void ContributeComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { newComponents.ContributeLifecycleListener <MicroserviceHostSmokeTest.SmokeTestComponent>(); }