public static ILifetimeScope CreateShellContainer_Obsolete(this ICoeveryHost host)
 {
     return(((DefaultCoeveryHost)host)
            .Current
            .Single(x => x.Settings.Name == ShellSettings.DefaultName)
            .LifetimeScope);
 }
예제 #2
0
        public override ServiceHostBase CreateServiceHost(string constructorString, Uri[] baseAddresses)
        {
            IComponentRegistration registration;

            if (constructorString == null)
            {
                throw new ArgumentNullException("constructorString");
            }

            if (constructorString == string.Empty)
            {
                throw new ArgumentOutOfRangeException("constructorString");
            }

            if (HostContainer == null)
            {
                throw new InvalidOperationException();
            }

            // Create work context
            IRunningShellTable runningShellTable = HostContainer.Resolve <IRunningShellTable>();
            ShellSettings      shellSettings     = runningShellTable.Match(baseAddresses.First().Host, baseAddresses.First().LocalPath);

            ICoeveryHost         CoeveryHost         = HostContainer.Resolve <ICoeveryHost>();
            ShellContext         shellContext        = CoeveryHost.GetShellContext(shellSettings);
            IWorkContextAccessor workContextAccessor = shellContext.LifetimeScope.Resolve <IWorkContextAccessor>();
            WorkContext          workContext         = workContextAccessor.GetContext();

            if (workContext == null)
            {
                using (IWorkContextScope workContextScope = workContextAccessor.CreateWorkContextScope()) {
                    ILifetimeScope lifetimeScope = workContextScope.Resolve <ILifetimeScope>();
                    registration = GetRegistration(lifetimeScope, constructorString);
                }
            }
            else
            {
                ILifetimeScope lifetimeScope = workContext.Resolve <ILifetimeScope>();
                registration = GetRegistration(lifetimeScope, constructorString);
            }

            if (registration == null)
            {
                throw new InvalidOperationException();
            }

            if (!registration.Activator.LimitType.IsClass)
            {
                throw new InvalidOperationException();
            }

            return(CreateServiceHost(workContextAccessor, registration, registration.Activator.LimitType, baseAddresses));
        }
 //private readonly IEnumerable<Recipe> _recipes;
 public SetupService(
     ShellSettings shellSettings,
     ICoeveryHost coeveryHost,
     IShellSettingsManager shellSettingsManager,
     IShellContainerFactory shellContainerFactory,
     ICompositionStrategy compositionStrategy,
     IProcessingEngine processingEngine)
 {
     _shellSettings = shellSettings;
     _coeveryHost = coeveryHost;
     _shellSettingsManager = shellSettingsManager;
     _shellContainerFactory = shellContainerFactory;
     _compositionStrategy = compositionStrategy;
     _processingEngine = processingEngine;
     //_recipes = recipeHarvester.HarvestRecipes("Coevery.Setup");
     T = NullLocalizer.Instance;
 }
예제 #4
0
        //private readonly IEnumerable<Recipe> _recipes;

        public SetupService(
            ShellSettings shellSettings,
            ICoeveryHost coeveryHost,
            IShellSettingsManager shellSettingsManager,
            IShellContainerFactory shellContainerFactory,
            ICompositionStrategy compositionStrategy,
            IProcessingEngine processingEngine)
        {
            _shellSettings         = shellSettings;
            _coeveryHost           = coeveryHost;
            _shellSettingsManager  = shellSettingsManager;
            _shellContainerFactory = shellContainerFactory;
            _compositionStrategy   = compositionStrategy;
            _processingEngine      = processingEngine;
            //_recipes = recipeHarvester.HarvestRecipes("Coevery.Setup");
            T = NullLocalizer.Instance;
        }
예제 #5
0
 private static void HostEndRequest(HttpApplication application, ICoeveryHost host)
 {
     host.EndRequest();
 }
예제 #6
0
 private static void HostBeginRequest(HttpApplication application, ICoeveryHost host)
 {
     application.Context.Items["originalHttpContext"] = application.Context;
     host.BeginRequest();
 }
 public static ICoeveryShell CreateShell_Obsolete(this ICoeveryHost host)
 {
     return(host.CreateShellContainer_Obsolete().Resolve <ICoeveryShell>());
 }
 private static void HostEndRequest(HttpApplication application, ICoeveryHost host)
 {
     host.EndRequest();
 }
 private static void HostBeginRequest(HttpApplication application, ICoeveryHost host)
 {
     application.Context.Items["originalHttpContext"] = application.Context;
     host.BeginRequest();
 }