|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GrailsPlugin
Plugin interface that adds Spring BeanDefinition
s
to a registry based on a GrailsApplication
object. After all GrailsPlugin
classes
have been processed the BeanDefinition
s in the registry are
loaded in a Spring ApplicationContext
that's the singular
configuration unit of Grails applications.
It's up to implementation classes to determine where GrailsPlugin
instances are loaded
from.
BeanDefinitionRegistry
Field Summary | |
---|---|
static String |
ARTEFACTS
Define the list of ArtefactHandlers supporting by the plugin |
static String |
DEPENDS_ON
Defines the name of the property that specifies which plugins this plugin depends on |
static String |
DO_WITH_APPLICATION_CONTEXT
Defines the name of the property that defines a closure that will be invoked after intialisation and when the application context has been built |
static String |
DO_WITH_DYNAMIC_METHODS
|
static String |
DO_WITH_SPRING
Defines the name of the property that defines the closure that will be invoked during runtime spring configuration |
static String |
DO_WITH_WEB_DESCRIPTOR
Defines the name of the property that defines the closure that will be invoked when the web.xml is being generated |
static int |
EVENT_ON_CHANGE
|
static int |
EVENT_ON_CONFIG_CHANGE
|
static String |
EVICT
Defines the name of the property that specifies a List or plugins that this plugin evicts Eviction occurs when the PluginManager loads |
static String |
INFLUENCES
Defines the name of the property that defines a list of plugin names that this plugin influences. |
static String |
ON_CHANGE
Defines the name of the property that defines the closure that will be invoked when a watched resource changes |
static String |
ON_CONFIG_CHANGE
Defines the name of the property that defines the closure that will be invoked when a the Grails configuration object changes |
static String |
PROVIDED_ARTEFACTS
The name of the property that provides a list of shipped, but overridable artefactssw |
static String |
STATUS
The status of the plugin |
static String |
STATUS_DISABLED
When a plugin is "disabled" it will not be loaded |
static String |
STATUS_ENABLED
When a plugin is "enabled" it will be loaded as usual |
static String |
TRAILING_NAME
Defines the convention that appears within plugin class names |
static String |
VERSION
Defines the name of the property that specifies the plugin version |
static String |
WATCHED_RESOURCES
Defines the name of the property that specifies resources which this plugin monitors for changes in the format a Ant-style path |
Method Summary | |
---|---|
boolean |
checkForChanges()
When called this method checks for any changes to the plug-ins watched resources and reloads appropriately |
void |
doArtefactConfiguration()
Called prior to the initialisation of the GrailsApplication instance to allow the registration of additonal ArtefactHandlers |
void |
doWithApplicationContext(ApplicationContext applicationContext)
This method is called to allow the plugin to add BeanDefinition s
to the BeanDefinitionRegistry . |
void |
doWithDynamicMethods(ApplicationContext applicationContext)
Calls a "doWithDynamicMethods" closure that allows a plugin to register dynamic methods at runtime |
void |
doWithRuntimeConfiguration(RuntimeSpringConfiguration springConfig)
Executes the plugin code that performs runtime configuration as defined in the doWithSpring closure |
void |
doWithWebDescriptor(groovy.util.slurpersupport.GPathResult webXml)
Handles processing of web.xml. |
String[] |
getDependencyNames()
|
String |
getDependentVersion(String name)
The version of the specified dependency |
String[] |
getEvictionNames()
|
groovy.lang.GroovyObject |
getInstance()
Retrieves the wrapped plugin instance for this plugin |
String[] |
getLoadAfterNames()
Retrieves the names of plugins that this plugin should be loaded after. |
GrailsPluginManager |
getManager()
Retrieves the plugin manager if known, otherwise returns null |
String |
getName()
|
String[] |
getObservedPluginNames()
Retrieve the plugin names that this plugin is observing for changes |
Class[] |
getProvidedArtefacts()
Retrieves an array of provided Artefacts that are pre-compiled additions to the GrailsApplication object but are overridable by the end-user |
String |
getVersion()
|
boolean |
isEnabled()
|
Map |
notifyOfEvent(int eventKind,
Object source)
Notifies the plugin of a specific event for the given event id, which is one of ON_CHANGE, ON_CONFIG_CHANGE |
void |
notifyOfEvent(Map event)
Notifies this plugin of the specified Event calling the onChange listener |
void |
refresh()
Refreshes this Grails plugin reloading any watched resources as necessary |
void |
setApplication(GrailsApplication application)
|
void |
setManager(GrailsPluginManager manager)
Sets the plugin manager for this plugin |
Methods inherited from interface org.springframework.context.ApplicationContextAware |
---|
setApplicationContext |
Field Detail |
---|
static final int EVENT_ON_CHANGE
static final int EVENT_ON_CONFIG_CHANGE
static final String DO_WITH_DYNAMIC_METHODS
static final String WATCHED_RESOURCES
static final String EVICT
static final String STATUS
static final String STATUS_ENABLED
static final String STATUS_DISABLED
static final String INFLUENCES
static final String ON_CHANGE
static final String ON_CONFIG_CHANGE
static final String DO_WITH_WEB_DESCRIPTOR
static final String TRAILING_NAME
static final String VERSION
static final String DO_WITH_SPRING
static final String DO_WITH_APPLICATION_CONTEXT
static final String DEPENDS_ON
static final String ARTEFACTS
static final String PROVIDED_ARTEFACTS
Method Detail |
---|
void doWithApplicationContext(ApplicationContext applicationContext)
This method is called to allow the plugin to add BeanDefinition
s
to the BeanDefinitionRegistry
.
applicationContext
- The Spring ApplicationContext instancevoid doWithRuntimeConfiguration(RuntimeSpringConfiguration springConfig)
springConfig
- The RuntimeSpringConfiguration instancevoid doWithWebDescriptor(groovy.util.slurpersupport.GPathResult webXml)
webXml
- The GPathResult representing web.xmlString getName()
String getVersion()
String[] getDependencyNames()
String[] getEvictionNames()
String[] getLoadAfterNames()
String getDependentVersion(String name)
name
- the name of the dependency
boolean checkForChanges()
void refresh()
GrailsPluginManager getManager()
groovy.lang.GroovyObject getInstance()
void setManager(GrailsPluginManager manager)
manager
- A GrailsPluginManager instancevoid setApplication(GrailsApplication application)
void doWithDynamicMethods(ApplicationContext applicationContext)
applicationContext
- The Spring ApplicationContext instanceboolean isEnabled()
String[] getObservedPluginNames()
void notifyOfEvent(Map event)
event
- The event to listen forMap notifyOfEvent(int eventKind, Object source)
eventKind
- The event kindsource
- The source of the event
void doArtefactConfiguration()
ArtefactHandler
Class[] getProvidedArtefacts()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |