Exemplo n.º 1
0
        public override void ContributeAdapterComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents)
        {
            base.ContributeAdapterComponents(existingComponents, newComponents);

            var platformConfig = existingComponents.Resolve <IMessagingPlatformConfiguration>();

            var webAppPorts         = existingComponents.ResolveAll <WebAppInjectorPort>();
            var httpEndpointConfigs = existingComponents.ResolveAll <HttpEndpointInjectorPort>()
                                      .Select(endpoint => platformConfig.Endpoints[endpoint.Name])
                                      .Cast <IHttpEndpointConfig>()
                                      .ToArray();

            foreach (var appPort in webAppPorts)
            {
                var assetFolderPath = PathUtility.ExpandPathFromBinary(
                    "GeneratedDeployables",
                    "NWheels.Frameworks.Uidl.Adapters.WebAngular",
                    appPort.ApplicationName);

                foreach (var endpointConfig in httpEndpointConfigs)
                {
                    endpointConfig.StaticFolders.Add(ConfigureStaticResourceFolder(
                                                         appPort.UriPathBase,
                                                         assetFolderPath,
                                                         platformConfig.NewHttpStaticFolderConfig()));
                }
            }
        }
Exemplo n.º 2
0
            public override void ContributeAdapterComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents)
            {
                base.ContributeAdapterComponents(existingComponents, newComponents);

                var allPortsA = existingComponents.ResolveAll <ExamplePortA>();

                foreach (var port in allPortsA)
                {
                    newComponents.RegisterComponentType <ExampleAdapterA>()
                    .WithParameter <ExamplePortA>(port)
                    .SingleInstance()
                    .ForServices <IExampleAdapterA, ILifecycleListenerComponent>();
                }

                var allPortsB = existingComponents.ResolveAll <ExamplePortB>();

                foreach (var port in allPortsB)
                {
                    newComponents.RegisterComponentType <ExampleAdapterB>()
                    .WithParameter <ExamplePortB>(port)
                    .SingleInstance()
                    .ForServices <IExampleAdapterB, ILifecycleListenerComponent>();
                }
            }
Exemplo n.º 3
0
        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>();
            }
        }