@groovy.transform.CompileStaticCompileStatic abstract class Plugin extends java.lang.Object
Super class for plugins to implement. Plugin implementations should define the various plugin hooks (doWithSpring, doWithApplicationContext, doWithDynamicMethods etc.)
Type | Name and description |
---|---|
ConfigurableApplicationContext |
applicationContext |
private java.util.List |
artefacts List of ArtefactHandler instances provided by this plugin |
private boolean |
enabled Whether the plugin is enabled |
private Environment |
environment The current Grails Environment |
private GrailsApplication |
grailsApplication The GrailsApplication instance |
private GrailsPlugin |
plugin The GrailsPlugin definition for this plugin |
private GrailsPluginManager |
pluginManager The GrailsPluginManager instance |
Constructor and description |
---|
Plugin
() |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
beans(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. |
|
Closure |
doWithSpring() Sub classes should override to provide implementations
|
|
ConfigurableApplicationContext |
getApplicationContext()
|
|
Config |
getConfig()
|
|
GrailsPluginManager |
getManager() The GrailsPluginManager instance |
|
void |
onChange(Map event) Invoked when a object this plugin is watching changes
|
|
void |
onConfigChange(Map event) Invoked when the application configuration changes
|
|
void |
onShutdown(Map event) Invoked when the ApplicationContext is closed
|
|
void |
onStartup(Map event) |
|
void |
setApplicationContext(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 event