@groovy.transform.CompileStatic abstract class Plugin extends java.lang.Object implements GrailsApplicationAware, GrailsApplicationLifeCycle, org.springframework.context.ApplicationContextAware, PluginManagerAware
Super class for plugins to implement. Plugin implementations should define the various plugin hooks (doWithSpring, doWithApplicationContext, doWithDynamicMethods etc.)
Type | Name and description |
---|---|
org.springframework.context.ConfigurableApplicationContext |
applicationContext |
java.util.List<ArtefactHandler> |
artefacts List of ArtefactHandler instances provided by this plugin |
boolean |
enabled Whether the plugin is enabled |
Environment |
environment The current Grails Environment |
GrailsApplication |
grailsApplication The GrailsApplication instance |
GrailsPlugin |
plugin The GrailsPlugin definition for this plugin |
GrailsPluginManager |
pluginManager The GrailsPluginManager instance |
Constructor and description |
---|
Plugin
() |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
beans(groovy.lang.Closure beanDefinitions) Allows a plugin to define beans at runtime. |
|
void |
doWithApplicationContext() Invokes once the ApplicationContext has been refreshed and after {#doWithDynamicMethods()} is invoked. |
|
void |
doWithDynamicMethods() Invoked in a phase where plugins can add dynamic methods. |
|
groovy.lang.Closure |
doWithSpring() Sub classes should override to provide implementations |
|
org.springframework.context.ConfigurableApplicationContext |
getApplicationContext()
|
|
Config |
getConfig()
|
|
GrailsPluginManager |
getManager() The GrailsPluginManager instance |
|
void |
onChange(java.util.Map<java.lang.String, java.lang.Object> event) Invoked when a object this plugin is watching changes |
|
void |
onConfigChange(java.util.Map<java.lang.String, java.lang.Object> event) Invoked when the application configuration changes |
|
void |
onShutdown(java.util.Map<java.lang.String, java.lang.Object> event) Invoked when the ApplicationContext is closed |
|
void |
onStartup(java.util.Map<java.lang.String, java.lang.Object> event) |
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
List of ArtefactHandler instances provided by this plugin
Whether the plugin is enabled
The current Grails Environment
The GrailsApplication instance
The GrailsPlugin definition for this plugin
The GrailsPluginManager instance
Allows a plugin to define beans at runtime. Used primarily for reloading in development mode
beanDefinitions
- The bean definitionsInvokes once the ApplicationContext has been refreshed and after {#doWithDynamicMethods()} is invoked. Subclasses should override
Invoked in a phase where plugins can add dynamic methods. Subclasses should override
Sub classes should override to provide implementations
The GrailsPluginManager instance
Invoked when a object this plugin is watching changes
event
- The eventInvoked when the application configuration changes
event
- The eventInvoked when the ApplicationContext is closed
event
- The eventGroovy Documentation