public abstract class AbstractGrailsPluginManager extends java.lang.Object implements GrailsPluginManager
| Modifier and Type | Field and Description |
|---|---|
protected GrailsApplication |
application |
protected org.springframework.context.ApplicationContext |
applicationContext |
protected java.util.Map<java.lang.String,GrailsPlugin> |
classNameToPluginMap |
static java.lang.String |
CONFIG_FILE |
protected java.util.Map<java.lang.String,GrailsPlugin> |
failedPlugins |
protected boolean |
initialised |
protected boolean |
loadCorePlugins |
protected java.lang.Class<?>[] |
pluginClasses |
protected java.util.List<GrailsPlugin> |
pluginList |
protected org.springframework.core.io.Resource[] |
pluginResources |
protected java.util.Map<java.lang.String,GrailsPlugin> |
plugins |
protected boolean |
shutdown |
BEAN_NAME| Constructor and Description |
|---|
AbstractGrailsPluginManager(GrailsApplication application) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkInitialised() |
void |
doArtefactConfiguration()
Called prior to the initialisation of the GrailsApplication object to allow registration of additional ArtefactHandler objects
|
void |
doDynamicMethods()
Called on all plugins so that they can add new methods/properties/constructors etc.
|
void |
doPostProcessing(org.springframework.context.ApplicationContext ctx)
Base implementation that will simply go through each plugin and call doWithApplicationContext on each.
|
void |
doRuntimeConfiguration(org.codehaus.groovy.grails.commons.spring.RuntimeSpringConfiguration springConfig)
Base implementation that simply goes through the list of plugins and calls doWithRuntimeConfiguration on each
|
void |
doRuntimeConfiguration(java.lang.String pluginName,
org.codehaus.groovy.grails.commons.spring.RuntimeSpringConfiguration springConfig)
Base implementation that will perform runtime configuration for the specified plugin name.
|
GrailsPlugin[] |
getAllPlugins()
Returns an array of all the loaded plug-ins
|
GrailsPlugin[] |
getFailedLoadPlugins() |
GrailsPlugin |
getFailedPlugin(java.lang.String name)
Retrieves a plug-in that failed to load, or null if it doesn't exist
|
GrailsPlugin |
getGrailsPlugin(java.lang.String name)
Retrieves a name Grails plugin instance
|
GrailsPlugin |
getGrailsPlugin(java.lang.String name,
java.lang.Object version)
Retrieves a plug-in for its name and version
|
GrailsPlugin |
getGrailsPluginForClassName(java.lang.String name)
Obtains a GrailsPlugin for the given classname
|
GrailsPlugin |
getPluginForClass(java.lang.Class<?> theClass)
Obtains the GrailsPlugin for the given class
|
GrailsPlugin |
getPluginForInstance(java.lang.Object instance)
Looks up the plugin that defined the given instance.
|
java.lang.String |
getPluginPath(java.lang.String name)
Returns the pluginContextPath for the given plugin
|
java.lang.String |
getPluginPathForClass(java.lang.Class<?> theClass)
Returns the plugin path for the given class
|
java.lang.String |
getPluginPathForInstance(java.lang.Object instance)
Returns the pluginContextPath for the given instance
|
org.springframework.core.io.Resource[] |
getPluginResources() |
java.lang.String |
getPluginViewsPathForClass(java.lang.Class<?> theClass)
Returns the plugin views directory path for the given class
|
java.lang.String |
getPluginViewsPathForInstance(java.lang.Object instance)
Returns the plugin views directory for the given instance
|
java.util.List<org.springframework.core.type.filter.TypeFilter> |
getTypeFilters()
Get all of the TypeFilter definitions defined by the plugins
|
boolean |
hasGrailsPlugin(java.lang.String name) |
void |
informOfClassChange(java.lang.Class<?> aClass)
Method for handling changes to a class and triggering on change events etc.
|
void |
informOfClassChange(java.io.File file,
java.lang.Class cls) |
void |
informOfFileChange(java.io.File file)
Fire to inform the PluginManager that a particular file changes
|
void |
informPluginsOfConfigChange() |
boolean |
isInitialised() |
boolean |
isShutdown()
Indicates whether the manager has been shutdown or not
|
void |
registerProvidedArtefacts(GrailsApplication app)
Registers pre-compiled artefacts with the GrailsApplication instance, only overriding if the
application doesn't already provide an artefact of the same name.
|
void |
setApplication(GrailsApplication application)
Sets the GrailsApplication used be this plugin manager
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setLoadCorePlugins(boolean shouldLoadCorePlugins)
Set whether the core plugins should be loaded
|
void |
shutdown()
Shuts down the PluginManager
|
boolean |
supportsCurrentBuildScope(java.lang.String pluginName)
Returns true if the given plugin supports the current BuildScope
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckForChanges, doWebDescriptor, doWebDescriptor, getPluginObservers, getUserPlugins, informObservers, loadPlugins, refreshPluginpublic static final java.lang.String CONFIG_FILE
protected java.util.List<GrailsPlugin> pluginList
protected GrailsApplication application
protected org.springframework.core.io.Resource[] pluginResources
protected java.util.Map<java.lang.String,GrailsPlugin> plugins
protected java.util.Map<java.lang.String,GrailsPlugin> classNameToPluginMap
protected java.lang.Class<?>[] pluginClasses
protected boolean initialised
protected boolean shutdown
protected org.springframework.context.ApplicationContext applicationContext
protected java.util.Map<java.lang.String,GrailsPlugin> failedPlugins
protected boolean loadCorePlugins
public AbstractGrailsPluginManager(GrailsApplication application)
public java.util.List<org.springframework.core.type.filter.TypeFilter> getTypeFilters()
GrailsPluginManagergetTypeFilters in interface GrailsPluginManagerpublic GrailsPlugin[] getAllPlugins()
GrailsPluginManagergetAllPlugins in interface GrailsPluginManagerpublic GrailsPlugin[] getFailedLoadPlugins()
getFailedLoadPlugins in interface GrailsPluginManagerpublic boolean isInitialised()
isInitialised in interface GrailsPluginManagerprotected void checkInitialised()
public GrailsPlugin getFailedPlugin(java.lang.String name)
GrailsPluginManagergetFailedPlugin in interface GrailsPluginManagername - The name of the pluginpublic void doRuntimeConfiguration(org.codehaus.groovy.grails.commons.spring.RuntimeSpringConfiguration springConfig)
doRuntimeConfiguration in interface GrailsPluginManagerspringConfig - The RuntimeSpringConfiguration instancepublic void doRuntimeConfiguration(java.lang.String pluginName,
org.codehaus.groovy.grails.commons.spring.RuntimeSpringConfiguration springConfig)
doRuntimeConfiguration in interface GrailsPluginManagerpluginName - The name of he pluginspringConfig - The runtime spring config instancepublic void doPostProcessing(org.springframework.context.ApplicationContext ctx)
doPostProcessing in interface GrailsPluginManagerctx - The ApplicationContext instancepublic org.springframework.core.io.Resource[] getPluginResources()
public GrailsPlugin getGrailsPlugin(java.lang.String name)
GrailsPluginManagergetGrailsPlugin in interface GrailsPluginManagername - The name of the pluginpublic GrailsPlugin getGrailsPluginForClassName(java.lang.String name)
GrailsPluginManagergetGrailsPluginForClassName in interface GrailsPluginManagername - The name of the pluginpublic GrailsPlugin getGrailsPlugin(java.lang.String name, java.lang.Object version)
GrailsPluginManagergetGrailsPlugin in interface GrailsPluginManagername - The name of the pluginversion - The version of the pluginpublic boolean hasGrailsPlugin(java.lang.String name)
hasGrailsPlugin in interface GrailsPluginManagername - The name of the pluginpublic void doDynamicMethods()
GrailsPluginManagerdoDynamicMethods in interface GrailsPluginManagerpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void setApplication(GrailsApplication application)
GrailsPluginManagersetApplication in interface GrailsPluginManagerapplication - The GrailsApplication instancepublic void registerProvidedArtefacts(GrailsApplication app)
GrailsPluginManagerregisterProvidedArtefacts in interface GrailsPluginManagerapp - The GrailsApplication objectpublic void doArtefactConfiguration()
GrailsPluginManagerdoArtefactConfiguration in interface GrailsPluginManagerArtefactHandlerpublic void shutdown()
GrailsPluginManagershutdown in interface GrailsPluginManagerpublic boolean isShutdown()
GrailsPluginManagerisShutdown in interface GrailsPluginManagerpublic boolean supportsCurrentBuildScope(java.lang.String pluginName)
GrailsPluginManagersupportsCurrentBuildScope in interface GrailsPluginManagerpluginName - The name of the pluginBuildScope.getCurrent()public void setLoadCorePlugins(boolean shouldLoadCorePlugins)
GrailsPluginManagersetLoadCorePlugins in interface GrailsPluginManagershouldLoadCorePlugins - True if they shouldpublic void informOfClassChange(java.lang.Class<?> aClass)
GrailsPluginManagerinformOfClassChange in interface GrailsPluginManageraClass - The classpublic java.lang.String getPluginPath(java.lang.String name)
GrailsPluginManagergetPluginPath in interface GrailsPluginManagername - The plugin namepublic java.lang.String getPluginPathForInstance(java.lang.Object instance)
GrailsPluginManagergetPluginPathForInstance in interface GrailsPluginManagerinstance - The instancepublic GrailsPlugin getPluginForInstance(java.lang.Object instance)
GrailsPluginManagergetPluginForInstance in interface GrailsPluginManagerinstance - The instancepublic GrailsPlugin getPluginForClass(java.lang.Class<?> theClass)
GrailsPluginManagergetPluginForClass in interface GrailsPluginManagertheClass - The classpublic void informPluginsOfConfigChange()
public void informOfFileChange(java.io.File file)
GrailsPluginManagerinformOfFileChange in interface GrailsPluginManagerfile - The file that changedpublic void informOfClassChange(java.io.File file,
java.lang.Class cls)
informOfClassChange in interface GrailsPluginManagerpublic java.lang.String getPluginPathForClass(java.lang.Class<?> theClass)
GrailsPluginManagergetPluginPathForClass in interface GrailsPluginManagertheClass - The classpublic java.lang.String getPluginViewsPathForInstance(java.lang.Object instance)
GrailsPluginManagergetPluginViewsPathForInstance in interface GrailsPluginManagerinstance - The instancepublic java.lang.String getPluginViewsPathForClass(java.lang.Class<?> theClass)
GrailsPluginManagergetPluginViewsPathForClass in interface GrailsPluginManagertheClass - The class