|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgroovy.lang.GroovyObjectSupport
org.codehaus.groovy.grails.plugins.AbstractGrailsPlugin
org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin
public class DefaultGrailsPlugin
Implementation of the GrailsPlugin interface that wraps a Groovy plugin class and provides the magic to invoke its various methods from Java.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.codehaus.groovy.grails.plugins.AbstractGrailsPlugin |
|---|
AbstractGrailsPlugin.GrailsPluginClass |
| Field Summary | |
|---|---|
protected BeanWrapper |
pluginBean
|
| Fields inherited from class org.codehaus.groovy.grails.plugins.AbstractGrailsPlugin |
|---|
application, applicationContext, dependencies, dependencyNames, evictionList, isBase, manager, pluginClass, version |
| Fields inherited from interface org.codehaus.groovy.grails.plugins.GrailsPlugin |
|---|
ARTEFACTS, DEPENDS_ON, DO_WITH_APPLICATION_CONTEXT, DO_WITH_DYNAMIC_METHODS, DO_WITH_SPRING, DO_WITH_WEB_DESCRIPTOR, ENVIRONMENTS, EVENT_ON_CHANGE, EVENT_ON_CONFIG_CHANGE, EVENT_ON_SHUTDOWN, EVICT, INFLUENCES, ON_CHANGE, ON_CONFIG_CHANGE, ON_SHUTDOWN, PLUGIN_EXCLUDES, PLUGIN_LOAD_AFTER_NAMES, PLUGIN_LOAD_BEFORE_NAMES, PLUGINS_PATH, PROVIDED_ARTEFACTS, SCOPES, STATUS, STATUS_DISABLED, STATUS_ENABLED, TYPE_FILTERS, WATCHED_RESOURCES |
| Fields inherited from interface org.codehaus.groovy.grails.plugins.GrailsPluginInfo |
|---|
NAME, TRAILING_NAME, VERSION |
| Constructor Summary | |
|---|---|
DefaultGrailsPlugin(Class<?> pluginClass,
GrailsApplication application)
|
|
DefaultGrailsPlugin(Class<?> pluginClass,
Resource resource,
GrailsApplication application)
|
|
| Method Summary | |
|---|---|
void |
addExclude(BuildScope buildScope)
Makes the plugin excluded for a particular BuildScope |
void |
addExclude(Environment env)
Makes the plugin excluded for a particular Environment |
BeanBuilder |
beans(groovy.lang.Closure closure)
|
boolean |
checkForChanges()
Monitors the plugin resources defined in the watchResources property for changes and fires onChange events by calling an onChange closure defined in the plugin (if it exists) |
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 ctx)
This method is called to allow the plugin to add BeanDefinitions
to the BeanDefinitionRegistry. |
void |
doWithDynamicMethods(ApplicationContext ctx)
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. |
protected void |
fireModifiedEvent(Resource resource,
GrailsPlugin grailsPlugin)
|
String[] |
getDependencyNames()
|
String |
getDependentVersion(String name)
The version of the specified dependency |
Resource |
getDescriptor()
Returns the location of the Resource that represents the plugin descriptor (the *GrailsPlugin.groovy file) |
String |
getFullName()
|
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. |
org.apache.commons.logging.Log |
getLog()
|
String |
getName()
|
String[] |
getObservedPluginNames()
Retrieve the plugin names that this plugin is observing for changes |
ApplicationContext |
getParentCtx()
|
GrailsPlugin |
getPlugin()
|
Resource |
getPluginDir()
|
List<String> |
getPluginExcludes()
A list of resources that the plugin should exclude from the packaged distribution |
Map |
getProperties()
|
Class<?>[] |
getProvidedArtefacts()
Retrieves an array of provided Artefacts that are pre-compiled additions to the GrailsApplication object but are overridable by the end-user |
PathMatchingResourcePatternResolver |
getResolver()
|
Collection<? extends TypeFilter> |
getTypeFilters()
Plugin can provide a list of Spring TypeFilters so that annotated components can be scanned into the ApplicationContext |
Resource[] |
getWatchedResources()
|
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 |
refresh(boolean fireEvent)
|
void |
restartContainer()
|
void |
setParentApplicationContext(ApplicationContext parent)
|
void |
setWatchedResources(Resource[] watchedResources)
|
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 |
String |
toString()
|
| Methods inherited from class org.codehaus.groovy.grails.plugins.AbstractGrailsPlugin |
|---|
compareTo, equals, getEvictionNames, getFileSystemName, getFileSystemShortName, getManager, getPluginClass, getPluginPath, getVersion, hashCode, isBasePlugin, setApplication, setApplicationContext, setBasePlugin, setManager |
| Methods inherited from class groovy.lang.GroovyObjectSupport |
|---|
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected BeanWrapper pluginBean
| Constructor Detail |
|---|
public DefaultGrailsPlugin(Class<?> pluginClass,
Resource resource,
GrailsApplication application)
public DefaultGrailsPlugin(Class<?> pluginClass,
GrailsApplication application)
| Method Detail |
|---|
public String[] getLoadAfterNames()
GrailsPlugin
getLoadAfterNames in interface GrailsPlugingetLoadAfterNames in class AbstractGrailsPluginpublic String[] getLoadBeforeNames()
GrailsPlugin
getLoadBeforeNames in interface GrailsPlugingetLoadBeforeNames in class AbstractGrailsPluginpublic PathMatchingResourcePatternResolver getResolver()
public ApplicationContext getParentCtx()
public BeanBuilder beans(groovy.lang.Closure closure)
public void doWithApplicationContext(ApplicationContext ctx)
GrailsPluginThis method is called to allow the plugin to add BeanDefinitions
to the BeanDefinitionRegistry.
doWithApplicationContext in interface GrailsPluginctx - The Spring ApplicationContext instancepublic void doWithRuntimeConfiguration(RuntimeSpringConfiguration springConfig)
GrailsPlugin
doWithRuntimeConfiguration in interface GrailsPluginspringConfig - The RuntimeSpringConfiguration instancepublic String getName()
getName in interface GrailsPluginInfogetName in class AbstractGrailsPluginpublic void addExclude(BuildScope buildScope)
GrailsPlugin
addExclude in interface GrailsPluginbuildScope - The BuildScopepublic void addExclude(Environment env)
GrailsPlugin
addExclude in interface GrailsPluginenv - The Environmentpublic boolean supportsScope(BuildScope buildScope)
GrailsPlugin
supportsScope in interface GrailsPluginbuildScope - The PluginScope
public boolean supportsEnvironment(Environment environment)
GrailsPlugin
supportsEnvironment in interface GrailsPluginenvironment - The environment name
public boolean supportsCurrentScopeAndEnvironment()
supportsCurrentScopeAndEnvironment in interface GrailsPluginpublic void doc(String text)
GrailsPlugin
doc in interface GrailsPluginpublic String[] getDependencyNames()
getDependencyNames in interface GrailsPlugingetDependencyNames in class AbstractGrailsPluginpublic Resource[] getWatchedResources()
public String getDependentVersion(String name)
GrailsPlugin
getDependentVersion in interface GrailsPlugingetDependentVersion in class AbstractGrailsPluginname - the name of the dependency
public String toString()
toString in class Objectpublic void doWithWebDescriptor(groovy.util.slurpersupport.GPathResult webXml)
GrailsPlugin
doWithWebDescriptor in interface GrailsPlugindoWithWebDescriptor in class AbstractGrailsPluginwebXml - The GPathResult representing web.xmlpublic boolean checkForChanges()
checkForChanges in interface GrailsPlugincheckForChanges in class AbstractGrailsPlugin
protected void fireModifiedEvent(Resource resource,
GrailsPlugin grailsPlugin)
public void restartContainer()
public void setWatchedResources(Resource[] watchedResources)
throws IOException
IOExceptionpublic org.apache.commons.logging.Log getLog()
public GrailsPlugin getPlugin()
public void setParentApplicationContext(ApplicationContext parent)
setParentApplicationContext in interface ParentApplicationContextAwarepublic void refresh()
GrailsPlugin
refresh in interface GrailsPluginrefresh in class AbstractGrailsPluginpublic void refresh(boolean fireEvent)
public groovy.lang.GroovyObject getInstance()
GrailsPlugin
getInstance in interface GrailsPluginpublic void doWithDynamicMethods(ApplicationContext ctx)
GrailsPlugin
doWithDynamicMethods in interface GrailsPluginctx - The Spring ApplicationContext instancepublic boolean isEnabled()
isEnabled in interface GrailsPluginpublic String[] getObservedPluginNames()
GrailsPlugin
getObservedPluginNames in interface GrailsPluginpublic void notifyOfEvent(Map event)
GrailsPlugin
notifyOfEvent in interface GrailsPluginevent - The event to listen for
public Map notifyOfEvent(int eventKind,
Object source)
GrailsPlugin
notifyOfEvent in interface GrailsPlugineventKind - The event kindsource - The source of the event
public void doArtefactConfiguration()
GrailsPlugin
doArtefactConfiguration in interface GrailsPluginArtefactHandlerpublic Class<?>[] getProvidedArtefacts()
GrailsPlugin
getProvidedArtefacts in interface GrailsPluginpublic List<String> getPluginExcludes()
GrailsPlugin
getPluginExcludes in interface GrailsPluginpublic Collection<? extends TypeFilter> getTypeFilters()
GrailsPlugin
getTypeFilters in interface GrailsPluginpublic String getFullName()
getFullName in interface GrailsPluginInfopublic Resource getDescriptor()
GrailsPluginInfo
getDescriptor in interface GrailsPluginInfopublic Resource getPluginDir()
getPluginDir in interface GrailsPluginInfopublic Map getProperties()
getProperties in interface GrailsPluginInfo
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||