Ejemplo n.º 1
0
        /// <summary>
        /// This is used when an IAction or IActionHandler is installed into the system
        /// and needs to be loaded into memory.
        /// </summary>
        /// <remarks>
        /// TODO: this shouldn't be needed... we should restart the app pool when a package is installed!
        /// </remarks>
        public static void ReRegisterActionsAndHandlers()
        {
            lock (Lock)
            {
                //TODO: Based on the above, this is a big hack as types should all be cleared on package install!
                ActionsResolver.Reset();
                ActionHandlers.Clear();

                //TODO: Based on the above, this is a big hack as types should all be cleared on package install!
                ActionsResolver.Current = new ActionsResolver(
                    () => TypeFinder.FindClassesOfType <IAction>(PluginManager.Current.AssembliesToScan));

                RegisterIActionHandlers();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This is used when an IAction or IActionHandler is installed into the system
        /// and needs to be loaded into memory.
        /// </summary>
        /// <remarks>
        /// TODO: this shouldn't be needed... we should restart the app pool when a package is installed!
        /// </remarks>
        public static void ReRegisterActionsAndHandlers()
        {
            lock (Lock)
            {
                using (Umbraco.Core.ObjectResolution.Resolution.DirtyBackdoorToConfiguration)
                {
                    //TODO: Based on the above, this is a big hack as types should all be cleared on package install!
                    ActionsResolver.Reset(false); // and do NOT reset the whole resolution!
                    ActionHandlers.Clear();

                    //TODO: Based on the above, this is a big hack as types should all be cleared on package install!
                    ActionsResolver.Current = new ActionsResolver(
                        () => TypeFinder.FindClassesOfType <IAction>(PluginManager.Current.AssembliesToScan));

                    RegisterIActionHandlers();
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This is used when an IAction or IActionHandler is installed into the system
        /// and needs to be loaded into memory.
        /// </summary>
        /// <remarks>
        /// TODO: this shouldn't be needed... we should restart the app pool when a package is installed!
        /// </remarks>
        public static void ReRegisterActionsAndHandlers()
        {
            lock (Lock)
            {
                // NOTE use the DirtyBackdoor to change the resolution configuration EXCLUSIVELY
                // ie do NOT do ANYTHING else while holding the backdoor, because while it is open
                // the whole resolution system is locked => nothing can work properly => deadlocks

                var newResolver = new ActionsResolver(
                    new ActivatorServiceProvider(), LoggerResolver.Current.Logger,
                    () => TypeFinder.FindClassesOfType <IAction>(PluginManager.Current.AssembliesToScan));

                using (Umbraco.Core.ObjectResolution.Resolution.DirtyBackdoorToConfiguration)
                {
                    ActionsResolver.Reset(false); // and do NOT reset the whole resolution!
                    ActionsResolver.Current = newResolver;
                }
            }
        }