@groovy.transform.CompileStatic abstract class Plugin extends java.lang.Object implements ApplicationContextAware, GrailsApplicationAware, GrailsApplicationLifeCycle, PluginManagerAware
Super class for plugins to implement. Plugin implementations should define the various plugin hooks (doWithSpring, doWithApplicationContext, doWithDynamicMethods etc.)
| Type | Name and description | 
|---|---|
ConfigurableApplicationContext  | 
                            applicationContext | 
                        
java.util.List<ArtefactHandler>  | 
                            artefactsList of ArtefactHandler instances provided by this plugin  | 
                        
boolean  | 
                            enabledWhether the plugin is enabled  | 
                        
Environment  | 
                            environmentThe current Grails Environment  | 
                        
GrailsApplication  | 
                            grailsApplicationThe GrailsApplication instance  | 
                        
GrailsPlugin  | 
                            pluginThe GrailsPlugin definition for this plugin  | 
                        
GrailsPluginManager  | 
                            pluginManagerThe 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  | 
                        
 | 
                            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(ApplicationContext applicationContext) | 
                        
| Methods inherited from class | Name | 
|---|---|
class java.lang.Object | 
                            java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) | 
                        
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