Groovy Documentation

org.codehaus.groovy.grails.plugins
[Java] Class DefaultGrailsPlugin

java.lang.Object
  groovy.lang.GroovyObjectSupport
      org.codehaus.groovy.grails.plugins.AbstractGrailsPlugin
          org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin
All Implemented Interfaces:
ParentApplicationContextAware

@SuppressWarnings("rawtypes")
public class DefaultGrailsPlugin
extends AbstractGrailsPlugin

Implementation of the GrailsPlugin interface that wraps a Groovy plugin class and provides the magic to invoke its various methods from Java.

Authors:
Graeme Rocher
Since:
0.4


Field Summary
protected BeanWrapper pluginBean

 
Fields inherited from class AbstractGrailsPlugin
application, applicationContext, dependencies, dependencyNames, evictionList, isBase, manager, pluginClass, version
 
Constructor Summary
DefaultGrailsPlugin(java.lang.Class pluginClass, Resource resource, GrailsApplication application)

DefaultGrailsPlugin(java.lang.Class pluginClass, GrailsApplication application)

 
Method Summary
void addExclude(BuildScope buildScope)

void addExclude(Environment env)

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()

void doWithApplicationContext(ApplicationContext ctx)

void doWithDynamicMethods(ApplicationContext ctx)

void doWithRuntimeConfiguration(RuntimeSpringConfiguration springConfig)

void doWithWebDescriptor(groovy.util.slurpersupport.GPathResult webXml)

void doc(java.lang.String text)

protected void fireModifiedEvent(Resource resource, GrailsPlugin grailsPlugin)

String[] getDependencyNames()

java.lang.String getDependentVersion(java.lang.String name)

Resource getDescriptor()

java.lang.String getFullName()

groovy.lang.GroovyObject getInstance()

String[] getLoadAfterNames()

String[] getLoadBeforeNames()

Log getLog()

java.lang.String getName()

String[] getObservedPluginNames()

ApplicationContext getParentCtx()

GrailsPlugin getPlugin()

Resource getPluginDir()

java.util.List getPluginExcludes()

java.util.Map getProperties()

Class[] getProvidedArtefacts()

PathMatchingResourcePatternResolver getResolver()

@return the resolver

java.util.Collection getTypeFilters()

Resource[] getWatchedResources()

@return the watchedResources

boolean isEnabled()

void notifyOfEvent(java.util.Map event)

java.util.Map notifyOfEvent(int eventKind, java.lang.Object source)

void refresh()

void refresh(boolean fireEvent)

void restartContainer()

void setParentApplicationContext(ApplicationContext parent)

void setWatchedResources(Resource[] watchedResources)

boolean supportsCurrentScopeAndEnvironment()

boolean supportsEnvironment(Environment environment)

boolean supportsScope(BuildScope buildScope)

java.lang.String toString()

 
Methods inherited from class AbstractGrailsPlugin
AbstractGrailsPlugin, checkForChanges, compareTo, doWithWebDescriptor, equals, getDependencyNames, getDependentVersion, getEvictionNames, getFileSystemName, getFileSystemShortName, getLoadAfterNames, getLoadBeforeNames, getManager, getName, getPluginClass, getPluginPath, getVersion, hashCode, isBasePlugin, refresh, setApplication, setApplicationContext, setBasePlugin, setManager
 
Methods inherited from class groovy.lang.GroovyObjectSupport
groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

pluginBean

protected BeanWrapper pluginBean


 
Constructor Detail

DefaultGrailsPlugin

public DefaultGrailsPlugin(java.lang.Class pluginClass, Resource resource, GrailsApplication application)


DefaultGrailsPlugin

public DefaultGrailsPlugin(java.lang.Class pluginClass, GrailsApplication application)


 
Method Detail

addExclude

public void addExclude(BuildScope buildScope)


addExclude

public void addExclude(Environment env)


beans

public BeanBuilder beans(groovy.lang.Closure closure)


checkForChanges

@Override
public 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)


doArtefactConfiguration

public void doArtefactConfiguration()


doWithApplicationContext

public void doWithApplicationContext(ApplicationContext ctx)


doWithDynamicMethods

public void doWithDynamicMethods(ApplicationContext ctx)


doWithRuntimeConfiguration

public void doWithRuntimeConfiguration(RuntimeSpringConfiguration springConfig)


doWithWebDescriptor

@Override
public void doWithWebDescriptor(groovy.util.slurpersupport.GPathResult webXml)


doc

public void doc(java.lang.String text)


fireModifiedEvent

protected void fireModifiedEvent(Resource resource, @SuppressWarnings("unused") GrailsPlugin grailsPlugin)


getDependencyNames

@Override
public String[] getDependencyNames()


getDependentVersion

@Override
public java.lang.String getDependentVersion(java.lang.String name)


getDescriptor

public Resource getDescriptor()


getFullName

public java.lang.String getFullName()


getInstance

public groovy.lang.GroovyObject getInstance()


getLoadAfterNames

@Override
public String[] getLoadAfterNames()


getLoadBeforeNames

@Override
public String[] getLoadBeforeNames()


getLog

public Log getLog()


getName

@Override
public java.lang.String getName()


getObservedPluginNames

public String[] getObservedPluginNames()


getParentCtx

public ApplicationContext getParentCtx()


getPlugin

public GrailsPlugin getPlugin()


getPluginDir

public Resource getPluginDir()


getPluginExcludes

public java.util.List getPluginExcludes()


getProperties

public java.util.Map getProperties()


getProvidedArtefacts

public Class[] getProvidedArtefacts()


getResolver

public PathMatchingResourcePatternResolver getResolver()
Returns:
the resolver


getTypeFilters

public java.util.Collection getTypeFilters()


getWatchedResources

public Resource[] getWatchedResources()
Returns:
the watchedResources


isEnabled

public boolean isEnabled()


notifyOfEvent

public void notifyOfEvent(java.util.Map event)


notifyOfEvent

@SuppressWarnings("serial")
public java.util.Map notifyOfEvent(int eventKind, java.lang.Object source)


refresh

@Override
public void refresh()


refresh

public void refresh(boolean fireEvent)


restartContainer

public void restartContainer()


setParentApplicationContext

public void setParentApplicationContext(ApplicationContext parent)


setWatchedResources

public void setWatchedResources(Resource[] watchedResources)


supportsCurrentScopeAndEnvironment

public boolean supportsCurrentScopeAndEnvironment()


supportsEnvironment

public boolean supportsEnvironment(Environment environment)


supportsScope

public boolean supportsScope(BuildScope buildScope)


toString

@Override
public java.lang.String toString()


 

Groovy Documentation