public Microsoft_Extensions_Hosting_IHostedService_nodeRegistration(Jasper.Messaging.Transports.Configuration.MessagingSettings messagingSettings, Jasper.Messaging.Runtime.Subscriptions.INodeDiscovery nodeDiscovery, Jasper.JasperRuntime jasperRuntime, Jasper.Messaging.Logging.IMessageLogger messageLogger)
 {
     _messagingSettings = messagingSettings;
     _nodeDiscovery     = nodeDiscovery;
     _jasperRuntime     = jasperRuntime;
     _messageLogger     = messageLogger;
 }
예제 #2
0
 public LightweightJasperStartup(JasperRuntime runtime, PerfTimer timer, Task handlerCompilation)
 {
     _runtime            = runtime;
     _timer              = timer;
     _handlerCompilation = handlerCompilation;
 }
예제 #3
0
 protected internal void Describe(JasperRuntime runtime, TextWriter writer)
 {
     Messaging.Describe(runtime, writer);
     HttpRoutes.Describe(runtime, writer);
 }
예제 #4
0
        private static async Task <JasperRuntime> bootstrap(JasperRegistry registry)
        {
            var timer = new PerfTimer();

            timer.Start("Bootstrapping");

            timer.Record("Finding and Applying Extensions", () =>
            {
                applyExtensions(registry);
            });

            var buildingServices = Task.Factory.StartNew(() =>
            {
                return(timer.Record("Combining Services and Building Settings", registry.CompileConfigurationAndServicesForIdiomaticBootstrapping));
            });



            var handlerCompilation = registry.Messaging.CompileHandlers(registry, timer);


            var runtime = new JasperRuntime(registry, timer);

            var services = await buildingServices;

            services.AddSingleton(runtime);


            var container = await Lamar.Container.BuildAsync(services, timer);

            container.DisposalLock = DisposalLock.Ignore;
            runtime.Container      = container;


            var routeDiscovery = registry.HttpRoutes.Enabled
                ? registry.HttpRoutes.FindRoutes(runtime, registry, timer)
                : Task.CompletedTask;

            runtime.buildAspNetCoreServer(services);

            await routeDiscovery;

            await Task.WhenAll(runtime.startAspNetCoreServer(), handlerCompilation, runtime.startHostedServices());


            // Run environment checks
            timer.Record("Environment Checks", () =>
            {
                var recorder = EnvironmentChecker.ExecuteAll(runtime);
                if (runtime.Settings.ThrowOnValidationErrors)
                {
                    recorder.AssertAllSuccessful();
                }
            });

            _lifetime = TypeExtensions.As <ApplicationLifetime>(container.GetInstance <IApplicationLifetime>());
            _lifetime.NotifyStarted();

            timer.Stop();

            return(runtime);
        }
 public Microsoft_Extensions_Hosting_IHostedService_messagingActivator(Jasper.JasperRuntime jasperRuntime, Jasper.Messaging.IMessagingRoot messagingRoot, Lamar.IoC.Scope topLevelScope) : base(topLevelScope)
 {
     _jasperRuntime = jasperRuntime;
     _messagingRoot = messagingRoot;
     _topLevelScope = topLevelScope;
 }