public abstract class AbstractGrailsPluginManager extends java.lang.Object implements GrailsPluginManager
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_FILE |
BEAN_NAME
Constructor and Description |
---|
AbstractGrailsPluginManager(GrailsApplication application) |
Modifier and Type | Method and Description |
---|---|
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(ApplicationContext ctx)
Base implementation that will simply go through each plugin and call doWithApplicationContext on each.
|
void |
doRuntimeConfiguration(RuntimeSpringConfiguration springConfig)
Base implementation that simply goes through the list of plugins and calls doWithRuntimeConfiguration on each
|
void |
doRuntimeConfiguration(java.lang.String pluginName,
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
|
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<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() |
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(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
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkForChanges, doWebDescriptor, getPluginObservers, getUserPlugins, informObservers, loadPlugins, refreshPlugin
public static final java.lang.String CONFIG_FILE
public AbstractGrailsPluginManager(GrailsApplication application)
public java.util.List<TypeFilter> getTypeFilters()
GrailsPluginManager
getTypeFilters
in interface GrailsPluginManager
public GrailsPlugin[] getAllPlugins()
GrailsPluginManager
getAllPlugins
in interface GrailsPluginManager
public GrailsPlugin[] getFailedLoadPlugins()
getFailedLoadPlugins
in interface GrailsPluginManager
public boolean isInitialised()
isInitialised
in interface GrailsPluginManager
public GrailsPlugin getFailedPlugin(java.lang.String name)
GrailsPluginManager
getFailedPlugin
in interface GrailsPluginManager
name
- The name of the pluginpublic void doRuntimeConfiguration(RuntimeSpringConfiguration springConfig)
doRuntimeConfiguration
in interface GrailsPluginManager
springConfig
- The RuntimeSpringConfiguration instancepublic void doRuntimeConfiguration(java.lang.String pluginName, RuntimeSpringConfiguration springConfig)
doRuntimeConfiguration
in interface GrailsPluginManager
pluginName
- The name of he pluginspringConfig
- The runtime spring config instancepublic void doPostProcessing(ApplicationContext ctx)
doPostProcessing
in interface GrailsPluginManager
ctx
- The ApplicationContext instancepublic Resource[] getPluginResources()
public GrailsPlugin getGrailsPlugin(java.lang.String name)
GrailsPluginManager
getGrailsPlugin
in interface GrailsPluginManager
name
- The name of the pluginpublic GrailsPlugin getGrailsPluginForClassName(java.lang.String name)
GrailsPluginManager
getGrailsPluginForClassName
in interface GrailsPluginManager
name
- The name of the pluginpublic GrailsPlugin getGrailsPlugin(java.lang.String name, java.lang.Object version)
GrailsPluginManager
getGrailsPlugin
in interface GrailsPluginManager
name
- The name of the pluginversion
- The version of the pluginpublic boolean hasGrailsPlugin(java.lang.String name)
hasGrailsPlugin
in interface GrailsPluginManager
name
- The name of the pluginpublic void doDynamicMethods()
GrailsPluginManager
doDynamicMethods
in interface GrailsPluginManager
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
BeansException
public void setApplication(GrailsApplication application)
GrailsPluginManager
setApplication
in interface GrailsPluginManager
application
- The GrailsApplication instancepublic void registerProvidedArtefacts(GrailsApplication app)
GrailsPluginManager
registerProvidedArtefacts
in interface GrailsPluginManager
app
- The GrailsApplication objectpublic void doArtefactConfiguration()
GrailsPluginManager
doArtefactConfiguration
in interface GrailsPluginManager
ArtefactHandler
public void shutdown()
GrailsPluginManager
shutdown
in interface GrailsPluginManager
public boolean supportsCurrentBuildScope(java.lang.String pluginName)
GrailsPluginManager
supportsCurrentBuildScope
in interface GrailsPluginManager
pluginName
- The name of the plugingrails.util.BuildScope#getCurrent()
public void setLoadCorePlugins(boolean shouldLoadCorePlugins)
GrailsPluginManager
setLoadCorePlugins
in interface GrailsPluginManager
shouldLoadCorePlugins
- True if they shouldpublic void informOfClassChange(java.lang.Class<?> aClass)
GrailsPluginManager
informOfClassChange
in interface GrailsPluginManager
aClass
- The classpublic java.lang.String getPluginPath(java.lang.String name)
GrailsPluginManager
getPluginPath
in interface GrailsPluginManager
name
- The plugin namepublic java.lang.String getPluginPathForInstance(java.lang.Object instance)
GrailsPluginManager
getPluginPathForInstance
in interface GrailsPluginManager
instance
- The instancepublic GrailsPlugin getPluginForInstance(java.lang.Object instance)
GrailsPluginManager
getPluginForInstance
in interface GrailsPluginManager
instance
- The instancepublic GrailsPlugin getPluginForClass(java.lang.Class<?> theClass)
GrailsPluginManager
getPluginForClass
in interface GrailsPluginManager
theClass
- The classpublic void informPluginsOfConfigChange()
public void informOfFileChange(java.io.File file)
GrailsPluginManager
informOfFileChange
in interface GrailsPluginManager
file
- The file that changedpublic void informOfClassChange(java.io.File file, java.lang.Class cls)
informOfClassChange
in interface GrailsPluginManager
public java.lang.String getPluginPathForClass(java.lang.Class<?> theClass)
GrailsPluginManager
getPluginPathForClass
in interface GrailsPluginManager
theClass
- The classpublic java.lang.String getPluginViewsPathForInstance(java.lang.Object instance)
GrailsPluginManager
getPluginViewsPathForInstance
in interface GrailsPluginManager
instance
- The instancepublic java.lang.String getPluginViewsPathForClass(java.lang.Class<?> theClass)
GrailsPluginManager
getPluginViewsPathForClass
in interface GrailsPluginManager
theClass
- The class