|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.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, 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, EVENT_ON_CHANGE, EVENT_ON_CONFIG_CHANGE, EVICT, INFLUENCES, ON_CHANGE, ON_CONFIG_CHANGE, PROVIDED_ARTEFACTS, STATUS, STATUS_DISABLED, STATUS_ENABLED, TRAILING_NAME, VERSION, WATCHED_RESOURCES |
Constructor Summary | |
---|---|
DefaultGrailsPlugin(Class pluginClass,
GrailsApplication application)
|
|
DefaultGrailsPlugin(Class pluginClass,
Resource resource,
GrailsApplication application)
|
Method Summary | |
---|---|
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 |
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. |
protected void |
fireModifiedEvent(Resource resource,
GrailsPlugin plugin)
|
String[] |
getDependencyNames()
|
String |
getDependentVersion(String name)
The version of the specified dependency |
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. |
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()
|
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()
|
String |
getVersion()
|
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)
|
String |
toString()
|
Methods inherited from class org.codehaus.groovy.grails.plugins.AbstractGrailsPlugin |
---|
getEvictionNames, getManager, setApplication, setApplicationContext, setManager |
Methods inherited from class groovy.lang.GroovyObjectSupport |
---|
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.codehaus.groovy.grails.plugins.GrailsPlugin |
---|
getEvictionNames, getManager, setApplication, setManager |
Methods inherited from interface org.springframework.context.ApplicationContextAware |
---|
setApplicationContext |
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 GrailsPlugin
getLoadAfterNames
in class AbstractGrailsPlugin
public PathMatchingResourcePatternResolver getResolver()
public ApplicationContext getParentCtx()
public BeanBuilder beans(groovy.lang.Closure closure)
public void doWithApplicationContext(ApplicationContext applicationContext)
GrailsPlugin
This method is called to allow the plugin to add BeanDefinition
s
to the BeanDefinitionRegistry
.
doWithApplicationContext
in interface GrailsPlugin
doWithApplicationContext
in class AbstractGrailsPlugin
applicationContext
- The Spring ApplicationContext instancepublic void doWithRuntimeConfiguration(RuntimeSpringConfiguration springConfig)
GrailsPlugin
doWithRuntimeConfiguration
in interface GrailsPlugin
doWithRuntimeConfiguration
in class AbstractGrailsPlugin
springConfig
- The RuntimeSpringConfiguration instancepublic String getName()
getName
in interface GrailsPlugin
getName
in class AbstractGrailsPlugin
public String getVersion()
getVersion
in interface GrailsPlugin
getVersion
in class AbstractGrailsPlugin
public String[] getDependencyNames()
getDependencyNames
in interface GrailsPlugin
getDependencyNames
in class AbstractGrailsPlugin
public Resource[] getWatchedResources()
public String getDependentVersion(String name)
GrailsPlugin
getDependentVersion
in interface GrailsPlugin
getDependentVersion
in class AbstractGrailsPlugin
name
- the name of the dependency
public String toString()
toString
in class Object
public void doWithWebDescriptor(groovy.util.slurpersupport.GPathResult webXml)
GrailsPlugin
doWithWebDescriptor
in interface GrailsPlugin
doWithWebDescriptor
in class AbstractGrailsPlugin
webXml
- The GPathResult representing web.xmlpublic boolean checkForChanges()
checkForChanges
in interface GrailsPlugin
checkForChanges
in class AbstractGrailsPlugin
protected void fireModifiedEvent(Resource resource, GrailsPlugin plugin)
public void restartContainer()
public void setWatchedResources(Resource[] watchedResources) throws IOException
IOException
public org.apache.commons.logging.Log getLog()
public GrailsPlugin getPlugin()
public void setParentApplicationContext(ApplicationContext parent)
setParentApplicationContext
in interface ParentApplicationContextAware
public void refresh()
GrailsPlugin
refresh
in interface GrailsPlugin
refresh
in class AbstractGrailsPlugin
public void refresh(boolean fireEvent)
public groovy.lang.GroovyObject getInstance()
GrailsPlugin
getInstance
in interface GrailsPlugin
public void doWithDynamicMethods(ApplicationContext applicationContext)
GrailsPlugin
doWithDynamicMethods
in interface GrailsPlugin
applicationContext
- The Spring ApplicationContext instancepublic boolean isEnabled()
isEnabled
in interface GrailsPlugin
public String[] getObservedPluginNames()
GrailsPlugin
getObservedPluginNames
in interface GrailsPlugin
public void notifyOfEvent(Map event)
GrailsPlugin
notifyOfEvent
in interface GrailsPlugin
event
- The event to listen forpublic Map notifyOfEvent(int eventKind, Object source)
GrailsPlugin
notifyOfEvent
in interface GrailsPlugin
eventKind
- The event kindsource
- The source of the event
public void doArtefactConfiguration()
GrailsPlugin
doArtefactConfiguration
in interface GrailsPlugin
doArtefactConfiguration
in class AbstractGrailsPlugin
ArtefactHandler
public Class[] getProvidedArtefacts()
GrailsPlugin
getProvidedArtefacts
in interface GrailsPlugin
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |