|
||||||||||
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 String |
ENVIRONMENTS
The environments to which this plugin applies |
static int |
EVENT_ON_CHANGE
|
static int |
EVENT_ON_CONFIG_CHANGE
|
static int |
EVENT_ON_SHUTDOWN
|
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 |
NAME
The name of the plugin |
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 |
ON_SHUTDOWN
Defines the name of the property that holds a closure to be invoked when shutdown is called |
static String |
PLUGIN_EXCLUDES
The field that reperesents the list of resources to exclude from plugin packaging |
static String |
PLUGIN_LOAD_AFTER_NAMES
The name of the property that provides a list of plugins this plugin should after before |
static String |
PLUGIN_LOAD_BEFORE_NAMES
The name of the property that provides a list of plugins this plugin should load before |
static String |
PLUGINS_PATH
The prefix used in plug-ins paths |
static String |
PROVIDED_ARTEFACTS
The name of the property that provides a list of shipped, but overridable artefactssw |
static String |
SCOPES
The scopes to which this plugin applies |
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 |
TYPE_FILTERS
The field that reperesents the list of type filters a plugin provides |
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 |
doc(String text)
Write some documentation to the DocumentationContext |
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()
|
String |
getFileSystemName()
Returns the name of the plugin as represented in the file system including the version. |
String |
getFileSystemShortName()
Returns the name of the plugin as represented on the file system without the version. |
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. |
String[] |
getLoadBeforeNames()
Retrieves the names of plugins that this plugin should be loaded before. |
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 |
getPluginClass()
Returns the underlying class that represents this plugin |
List<String> |
getPluginExcludes()
A list of resources that the plugin should exclude from the packaged distribution |
String |
getPluginPath()
Returns the path of the plug-in |
Class[] |
getProvidedArtefacts()
Retrieves an array of provided Artefacts that are pre-compiled additions to the GrailsApplication object but are overridable by the end-user |
Collection<? extends TypeFilter> |
getTypeFilters()
Plugin can provide a list of Spring TypeFilters so that annotated components can be scanned into the ApplicationContext |
String |
getVersion()
|
boolean |
isBasePlugin()
Returns whether this plugin is loaded from the current plugin. |
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 |
setBasePlugin(boolean isBase)
Sets whether this plugin is the base plugin |
void |
setManager(GrailsPluginManager manager)
Sets the plugin manager for this plugin |
boolean |
supportsCurrentScopeAndEnvironment()
|
boolean |
supportsEnvironment(Environment environment)
Returns whether this plugin supports the given environment name |
boolean |
supportsScope(BuildScope buildScope)
Return whether this plugin supports the given PluginScope |
Methods inherited from interface org.springframework.context.ApplicationContextAware |
---|
setApplicationContext |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
static final int EVENT_ON_CHANGE
static final int EVENT_ON_CONFIG_CHANGE
static final int EVENT_ON_SHUTDOWN
static final String DO_WITH_DYNAMIC_METHODS
static final String SCOPES
static final String ENVIRONMENTS
static final String PLUGINS_PATH
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_SHUTDOWN
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
static final String PLUGIN_LOAD_BEFORE_NAMES
static final String PLUGIN_LOAD_AFTER_NAMES
static final String PLUGIN_EXCLUDES
static final String TYPE_FILTERS
static final String NAME
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()
boolean supportsScope(BuildScope buildScope)
buildScope
- The PluginScope
boolean supportsEnvironment(Environment environment)
environment
- The environment name
boolean supportsCurrentScopeAndEnvironment()
String getVersion()
void doc(String text)
String getPluginPath()
String[] getDependencyNames()
String[] getEvictionNames()
String[] getLoadAfterNames()
String[] getLoadBeforeNames()
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()
String getFileSystemName()
String getFileSystemShortName()
Class getPluginClass()
List<String> getPluginExcludes()
boolean isBasePlugin()
void setBasePlugin(boolean isBase)
isBase
- True if isisBasePlugin()
Collection<? extends TypeFilter> getTypeFilters()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |