public class DefaultGrailsPlugin extends AbstractGrailsPlugin implements ParentApplicationContextAware
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
LOG |
protected org.springframework.beans.BeanWrapper |
pluginBean |
application, applicationContext, dependencies, dependencyNames, evictionList, isBase, manager, pluginClass, versionARTEFACTS, 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, OBSERVE, 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| Constructor and Description |
|---|
DefaultGrailsPlugin(java.lang.Class<?> pluginClass,
GrailsApplication application) |
DefaultGrailsPlugin(java.lang.Class<?> pluginClass,
org.springframework.core.io.Resource resource,
GrailsApplication application) |
| Modifier and Type | Method and Description |
|---|---|
void |
addExclude(grails.util.BuildScope buildScope)
Makes the plugin excluded for a particular BuildScope
|
void |
addExclude(grails.util.Environment env)
Makes the plugin excluded for a particular Environment
|
grails.spring.BeanBuilder |
beans(groovy.lang.Closure closure) |
boolean |
checkForChanges()
Deprecated.
|
void |
doArtefactConfiguration()
Called prior to the initialisation of the GrailsApplication instance to allow the registration
of additonal ArtefactHandlers
|
void |
doc(java.lang.String text)
Deprecated.
Dynamic document generation no longer supported
|
void |
doWithApplicationContext(org.springframework.context.ApplicationContext ctx)
This method is called to allow the plugin to add
BeanDefinitions
to the BeanDefinitionRegistry. |
void |
doWithDynamicMethods(org.springframework.context.ApplicationContext ctx)
Calls a "doWithDynamicMethods" closure that allows a plugin to register dynamic methods at runtime
|
void |
doWithRuntimeConfiguration(org.codehaus.groovy.grails.commons.spring.RuntimeSpringConfiguration springConfig)
Executes the plugin code that performs runtime configuration as defined in the doWithSpring closure
|
void |
doWithWebDescriptor(org.w3c.dom.Element webXml)
Handles processing of web.xml.
|
java.lang.String[] |
getDependencyNames() |
java.lang.String |
getDependentVersion(java.lang.String name)
The version of the specified dependency
|
org.codehaus.groovy.grails.io.support.Resource |
getDescriptor() |
java.lang.String |
getFullName() |
groovy.lang.GroovyObject |
getInstance()
Retrieves the wrapped plugin instance for this plugin
|
java.lang.String[] |
getLoadAfterNames()
Retrieves the names of plugins that this plugin should be loaded after.
|
java.lang.String[] |
getLoadBeforeNames()
Retrieves the names of plugins that this plugin should be loaded before.
|
org.apache.commons.logging.Log |
getLog() |
java.lang.String |
getName() |
java.lang.String[] |
getObservedPluginNames()
Retrieve the plugin names that this plugin is observing for changes
|
org.springframework.context.ApplicationContext |
getParentCtx() |
GrailsPlugin |
getPlugin() |
org.codehaus.groovy.grails.io.support.Resource |
getPluginDir() |
java.util.List<java.lang.String> |
getPluginExcludes()
A list of resources that the plugin should exclude from the packaged distribution
|
java.util.Map |
getProperties() |
java.lang.Class<?>[] |
getProvidedArtefacts()
Retrieves an array of provided Artefacts that are pre-compiled additions to the GrailsApplication object
but are overridable by the end-user
|
org.springframework.core.io.support.PathMatchingResourcePatternResolver |
getResolver() |
java.util.Collection<? extends org.springframework.core.type.filter.TypeFilter> |
getTypeFilters()
Plugin can provide a list of Spring TypeFilters so that annotated components can
be scanned into the ApplicationContext
|
java.util.List<org.codehaus.groovy.grails.plugins.support.WatchPattern> |
getWatchedResourcePatterns()
Resources that this plugin watches
|
org.springframework.core.io.Resource[] |
getWatchedResources() |
boolean |
hasInterestInChange(java.lang.String path)
Whether the plugin is interested in a particular change
|
boolean |
isEnabled() |
java.util.Map |
notifyOfEvent(int eventKind,
java.lang.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(java.util.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 |
restartContainer()
Deprecated.
Not needed any more due to the reload agent
|
void |
setDescriptor(org.springframework.core.io.Resource descriptor)
Sets the plugin descriptor for this plugin
|
void |
setParentApplicationContext(org.springframework.context.ApplicationContext parent) |
void |
setWatchedResources(org.springframework.core.io.Resource[] watchedResources) |
boolean |
supportsCurrentScopeAndEnvironment() |
boolean |
supportsEnvironment(grails.util.Environment environment)
Returns whether this plugin supports the given environment name
|
boolean |
supportsScope(grails.util.BuildScope buildScope)
Return whether this plugin supports the given PluginScope
|
java.lang.String |
toString() |
compareTo, equals, getEvictionNames, getFileSystemName, getFileSystemShortName, getManager, getPluginClass, getPluginPath, getVersion, hashCode, isBasePlugin, setApplication, setApplicationContext, setBasePlugin, setManagerprotected static final org.apache.commons.logging.Log LOG
protected org.springframework.beans.BeanWrapper pluginBean
public DefaultGrailsPlugin(java.lang.Class<?> pluginClass,
org.springframework.core.io.Resource resource,
GrailsApplication application)
public DefaultGrailsPlugin(java.lang.Class<?> pluginClass,
GrailsApplication application)
public java.util.List<org.codehaus.groovy.grails.plugins.support.WatchPattern> getWatchedResourcePatterns()
GrailsPlugingetWatchedResourcePatterns in interface GrailsPlugingetWatchedResourcePatterns in class AbstractGrailsPluginpublic boolean hasInterestInChange(java.lang.String path)
GrailsPluginhasInterestInChange in interface GrailsPluginhasInterestInChange in class AbstractGrailsPluginpath - The path to the resource that changedpublic java.lang.String[] getLoadAfterNames()
GrailsPlugingetLoadAfterNames in interface GrailsPlugingetLoadAfterNames in class AbstractGrailsPluginpublic java.lang.String[] getLoadBeforeNames()
GrailsPlugingetLoadBeforeNames in interface GrailsPlugingetLoadBeforeNames in class AbstractGrailsPluginpublic org.springframework.core.io.support.PathMatchingResourcePatternResolver getResolver()
public org.springframework.context.ApplicationContext getParentCtx()
public grails.spring.BeanBuilder beans(groovy.lang.Closure closure)
public void doWithApplicationContext(org.springframework.context.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(org.codehaus.groovy.grails.commons.spring.RuntimeSpringConfiguration springConfig)
GrailsPlugindoWithRuntimeConfiguration in interface GrailsPluginspringConfig - The RuntimeSpringConfiguration instancepublic java.lang.String getName()
getName in interface org.codehaus.groovy.grails.plugins.GrailsPluginInfogetName in class AbstractGrailsPluginpublic void addExclude(grails.util.BuildScope buildScope)
GrailsPluginaddExclude in interface GrailsPluginbuildScope - The BuildScopepublic void addExclude(grails.util.Environment env)
GrailsPluginaddExclude in interface GrailsPluginenv - The Environmentpublic boolean supportsScope(grails.util.BuildScope buildScope)
GrailsPluginsupportsScope in interface GrailsPluginbuildScope - The PluginScopepublic boolean supportsEnvironment(grails.util.Environment environment)
GrailsPluginsupportsEnvironment in interface GrailsPluginenvironment - The environment namepublic boolean supportsCurrentScopeAndEnvironment()
supportsCurrentScopeAndEnvironment in interface GrailsPlugin@Deprecated public void doc(java.lang.String text)
GrailsPlugindoc in interface GrailsPlugintext - public java.lang.String[] getDependencyNames()
getDependencyNames in interface GrailsPlugingetDependencyNames in class AbstractGrailsPluginpublic org.springframework.core.io.Resource[] getWatchedResources()
public java.lang.String getDependentVersion(java.lang.String name)
GrailsPlugingetDependentVersion in interface GrailsPlugingetDependentVersion in class AbstractGrailsPluginname - the name of the dependencypublic java.lang.String toString()
toString in class java.lang.Objectpublic void doWithWebDescriptor(org.w3c.dom.Element webXml)
GrailsPlugindoWithWebDescriptor in interface GrailsPlugindoWithWebDescriptor in class AbstractGrailsPluginwebXml - The GPathResult representing web.xml@Deprecated public boolean checkForChanges()
checkForChanges in interface GrailsPlugincheckForChanges in class AbstractGrailsPlugin@Deprecated public void restartContainer()
public void setWatchedResources(org.springframework.core.io.Resource[] watchedResources)
throws java.io.IOException
java.io.IOExceptionpublic org.apache.commons.logging.Log getLog()
public GrailsPlugin getPlugin()
public void setParentApplicationContext(org.springframework.context.ApplicationContext parent)
setParentApplicationContext in interface ParentApplicationContextAwarepublic void refresh()
GrailsPluginrefresh in interface GrailsPluginrefresh in class AbstractGrailsPluginpublic groovy.lang.GroovyObject getInstance()
GrailsPlugingetInstance in interface GrailsPluginpublic void doWithDynamicMethods(org.springframework.context.ApplicationContext ctx)
GrailsPlugindoWithDynamicMethods in interface GrailsPluginctx - The Spring ApplicationContext instancepublic boolean isEnabled()
isEnabled in interface GrailsPluginpublic java.lang.String[] getObservedPluginNames()
GrailsPlugingetObservedPluginNames in interface GrailsPluginpublic void notifyOfEvent(java.util.Map event)
GrailsPluginnotifyOfEvent in interface GrailsPluginevent - The event to listen forpublic java.util.Map notifyOfEvent(int eventKind,
java.lang.Object source)
GrailsPluginnotifyOfEvent in interface GrailsPlugineventKind - The event kindsource - The source of the eventpublic void doArtefactConfiguration()
GrailsPlugindoArtefactConfiguration in interface GrailsPluginArtefactHandlerpublic java.lang.Class<?>[] getProvidedArtefacts()
GrailsPlugingetProvidedArtefacts in interface GrailsPluginpublic java.util.List<java.lang.String> getPluginExcludes()
GrailsPlugingetPluginExcludes in interface GrailsPluginpublic java.util.Collection<? extends org.springframework.core.type.filter.TypeFilter> getTypeFilters()
GrailsPlugingetTypeFilters in interface GrailsPluginpublic java.lang.String getFullName()
getFullName in interface org.codehaus.groovy.grails.plugins.GrailsPluginInfopublic org.codehaus.groovy.grails.io.support.Resource getDescriptor()
getDescriptor in interface org.codehaus.groovy.grails.plugins.GrailsPluginInfopublic void setDescriptor(org.springframework.core.io.Resource descriptor)
GrailsPluginsetDescriptor in interface GrailsPlugindescriptor - The descriptorpublic org.codehaus.groovy.grails.io.support.Resource getPluginDir()
getPluginDir in interface org.codehaus.groovy.grails.plugins.GrailsPluginInfopublic java.util.Map getProperties()
getProperties in interface org.codehaus.groovy.grails.plugins.GrailsPluginInfo