Class AbstractGrailsPluginManager

    • Field Detail

      • pluginList

        protected java.util.List<GrailsPlugin> pluginList
      • pluginResources

        protected org.springframework.core.io.Resource[] pluginResources
      • plugins

        protected java.util.Map<java.lang.String,​GrailsPlugin> plugins
      • classNameToPluginMap

        protected java.util.Map<java.lang.String,​GrailsPlugin> classNameToPluginMap
      • pluginClasses

        protected java.lang.Class<?>[] pluginClasses
      • initialised

        protected boolean initialised
      • shutdown

        protected boolean shutdown
      • applicationContext

        protected org.springframework.context.ApplicationContext applicationContext
      • failedPlugins

        protected java.util.Map<java.lang.String,​GrailsPlugin> failedPlugins
      • loadCorePlugins

        protected boolean loadCorePlugins
    • Constructor Detail

      • AbstractGrailsPluginManager

        public AbstractGrailsPluginManager​(GrailsApplication application)
    • Method Detail

      • getTypeFilters

        public java.util.List<org.springframework.core.type.filter.TypeFilter> getTypeFilters()
        Description copied from interface: GrailsPluginManager
        Get all of the TypeFilter definitions defined by the plugins
        Specified by:
        getTypeFilters in interface GrailsPluginManager
        Returns:
        A list of TypeFilter definitions
      • checkInitialised

        protected void checkInitialised()
      • getFailedPlugin

        public GrailsPlugin getFailedPlugin​(java.lang.String name)
        Description copied from interface: GrailsPluginManager
        Retrieves a plug-in that failed to load, or null if it doesn't exist
        Specified by:
        getFailedPlugin in interface GrailsPluginManager
        Parameters:
        name - The name of the plugin
        Returns:
        A GrailsPlugin or null
      • doRuntimeConfiguration

        public void doRuntimeConfiguration​(org.grails.spring.RuntimeSpringConfiguration springConfig)
        Base implementation that simply goes through the list of plugins and calls doWithRuntimeConfiguration on each
        Specified by:
        doRuntimeConfiguration in interface GrailsPluginManager
        Parameters:
        springConfig - The RuntimeSpringConfiguration instance
      • doRuntimeConfiguration

        public void doRuntimeConfiguration​(java.lang.String pluginName,
                                           org.grails.spring.RuntimeSpringConfiguration springConfig)
        Base implementation that will perform runtime configuration for the specified plugin name.
        Specified by:
        doRuntimeConfiguration in interface GrailsPluginManager
        Parameters:
        pluginName - The name of he plugin
        springConfig - The runtime spring config instance
      • doPostProcessing

        public void doPostProcessing​(org.springframework.context.ApplicationContext ctx)
        Base implementation that will simply go through each plugin and call doWithApplicationContext on each.
        Specified by:
        doPostProcessing in interface GrailsPluginManager
        Parameters:
        ctx - The ApplicationContext instance
      • getPluginResources

        public org.springframework.core.io.Resource[] getPluginResources()
      • getGrailsPlugin

        public GrailsPlugin getGrailsPlugin​(java.lang.String name)
        Description copied from interface: GrailsPluginManager
        Retrieves a name Grails plugin instance
        Specified by:
        getGrailsPlugin in interface GrailsPluginManager
        Parameters:
        name - The name of the plugin
        Returns:
        The GrailsPlugin instance or null if it doesn't exist
      • getGrailsPlugin

        public GrailsPlugin getGrailsPlugin​(java.lang.String name,
                                            java.lang.Object version)
        Description copied from interface: GrailsPluginManager
        Retrieves a plug-in for its name and version
        Specified by:
        getGrailsPlugin in interface GrailsPluginManager
        Parameters:
        name - The name of the plugin
        version - The version of the plugin
        Returns:
        The GrailsPlugin instance or null if it doesn't exist
      • hasGrailsPlugin

        public boolean hasGrailsPlugin​(java.lang.String name)
        Specified by:
        hasGrailsPlugin in interface GrailsPluginManager
        Parameters:
        name - The name of the plugin
        Returns:
        true if the the manager has a loaded plugin with the given name
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • registerProvidedArtefacts

        public void registerProvidedArtefacts​(GrailsApplication app)
        Description copied from interface: GrailsPluginManager
        Registers pre-compiled artefacts with the GrailsApplication instance, only overriding if the application doesn't already provide an artefact of the same name.
        Specified by:
        registerProvidedArtefacts in interface GrailsPluginManager
        Parameters:
        app - The GrailsApplication object
      • isPluginDisabledForProfile

        protected boolean isPluginDisabledForProfile​(GrailsPlugin plugin)
      • onStartup

        public void onStartup​(java.util.Map<java.lang.String,​java.lang.Object> event)
        Description copied from interface: GrailsPluginManager
        Executes the Plugin.onStartup(Map) hook for all plugins
        Specified by:
        onStartup in interface GrailsPluginManager
        Parameters:
        event - the Event
      • isShutdown

        public boolean isShutdown()
        Description copied from interface: GrailsPluginManager
        Indicates whether the manager has been shutdown or not
        Specified by:
        isShutdown in interface GrailsPluginManager
        Returns:
        True if it was shutdown
      • setLoadCorePlugins

        public void setLoadCorePlugins​(boolean shouldLoadCorePlugins)
        Description copied from interface: GrailsPluginManager
        Set whether the core plugins should be loaded
        Specified by:
        setLoadCorePlugins in interface GrailsPluginManager
        Parameters:
        shouldLoadCorePlugins - True if they should
      • informOfClassChange

        public void informOfClassChange​(java.lang.Class<?> aClass)
        Description copied from interface: GrailsPluginManager
        Method for handling changes to a class and triggering on change events etc.
        Specified by:
        informOfClassChange in interface GrailsPluginManager
        Parameters:
        aClass - The class
      • getPluginPath

        public java.lang.String getPluginPath​(java.lang.String name)
        Description copied from interface: GrailsPluginManager
        Returns the pluginContextPath for the given plugin
        Specified by:
        getPluginPath in interface GrailsPluginManager
        Parameters:
        name - The plugin name
        Returns:
        the context path
      • getPluginPath

        public java.lang.String getPluginPath​(java.lang.String name,
                                              boolean forceCamelCase)
        Description copied from interface: GrailsPluginManager
        Returns the pluginContextPath for the given plugin and will force name to camel case instead of '-' lower case my-plug-web would resolve to myPlugWeb if forceCamelCase is true.
        Specified by:
        getPluginPath in interface GrailsPluginManager
        Parameters:
        name - The plugin name
        forceCamelCase - Force camel case for name
        Returns:
        the context path
      • getPluginPathForInstance

        public java.lang.String getPluginPathForInstance​(java.lang.Object instance)
        Description copied from interface: GrailsPluginManager
        Returns the pluginContextPath for the given instance
        Specified by:
        getPluginPathForInstance in interface GrailsPluginManager
        Parameters:
        instance - The instance
        Returns:
        The pluginContextPath
      • getPluginForInstance

        public GrailsPlugin getPluginForInstance​(java.lang.Object instance)
        Description copied from interface: GrailsPluginManager
        Looks up the plugin that defined the given instance. If no plugin defined the instance then null is returned.
        Specified by:
        getPluginForInstance in interface GrailsPluginManager
        Parameters:
        instance - The instance
        Returns:
        The plugin that defined the instance or null
      • getPluginForClass

        public GrailsPlugin getPluginForClass​(java.lang.Class<?> theClass)
        Description copied from interface: GrailsPluginManager
        Obtains the GrailsPlugin for the given class
        Specified by:
        getPluginForClass in interface GrailsPluginManager
        Parameters:
        theClass - The class
        Returns:
        The GrailsPlugin for the given class or null if not related to any plugin
      • informOfFileChange

        public void informOfFileChange​(java.io.File file)
        Description copied from interface: GrailsPluginManager
        Fire to inform the PluginManager that a particular file changes
        Specified by:
        informOfFileChange in interface GrailsPluginManager
        Parameters:
        file - The file that changed
      • getPluginPathForClass

        public java.lang.String getPluginPathForClass​(java.lang.Class<?> theClass)
        Description copied from interface: GrailsPluginManager
        Returns the plugin path for the given class
        Specified by:
        getPluginPathForClass in interface GrailsPluginManager
        Parameters:
        theClass - The class
        Returns:
        The pluginContextPath
      • getPluginViewsPathForInstance

        public java.lang.String getPluginViewsPathForInstance​(java.lang.Object instance)
        Description copied from interface: GrailsPluginManager
        Returns the plugin views directory for the given instance
        Specified by:
        getPluginViewsPathForInstance in interface GrailsPluginManager
        Parameters:
        instance - The instance
        Returns:
        The pluginContextPath
      • getPluginViewsPathForClass

        public java.lang.String getPluginViewsPathForClass​(java.lang.Class<?> theClass)
        Description copied from interface: GrailsPluginManager
        Returns the plugin views directory path for the given class
        Specified by:
        getPluginViewsPathForClass in interface GrailsPluginManager
        Parameters:
        theClass - The class
        Returns:
        The pluginContextPath