Пример #1
0
        public static AzureServiceBusOwinServer Create(AzureServiceBusOwinServiceConfiguration config, Action <IAppBuilder> startup)
        {
            var server = new AzureServiceBusOwinServer();

            server.Configure(config, startup);
            return(server);
        }
Пример #2
0
        private void Configure(AzureServiceBusOwinServiceConfiguration config, Action <IAppBuilder> startup)
        {
            if (startup == null)
            {
                throw new ArgumentNullException("startup");
            }

            var options = new StartOptions();

            if (string.IsNullOrWhiteSpace(options.AppStartup))
            {
                // Populate AppStartup for use in host.AppName
                options.AppStartup = startup.Method.ReflectedType.FullName;
            }

            var serverFactory = new AzureServiceBusOwinServerFactory(config);
            var services      = ServicesFactory.Create();
            var engine        = services.GetService <IHostingEngine>();
            var context       = new StartContext(options)
            {
                ServerFactory = new ServerFactoryAdapter(serverFactory),
                Startup       = startup
            };

            _started = engine.Start(context);
        }
Пример #3
0
 public AzureServiceBusOwinServerFactory(AzureServiceBusOwinServiceConfiguration config)
 {
     _config = config;
 }