Package: org.grails.plugins

## [Java] Class DefaultGrailsPlugin

- org.grails.plugins.DefaultGrailsPlugin

- All Implemented Interfaces and Traits:
    ParentApplicationContextAware

      @java.lang.SuppressWarnings("rawtypes")
      public class DefaultGrailsPlugin
      extends AbstractGrailsPlugin
      implements ParentApplicationContextAware

  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

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private static java.lang.String` | `EXCLUDES` |
    `private static java.lang.String` | `INCLUDES` |
    `protected static org.apache.commons.logging.Log` | `LOG` |
    `private static java.lang.String` | `PLUGIN_CHANGE_EVENT_APPLICATION` |
    `private static java.lang.String` | `PLUGIN_CHANGE_EVENT_CTX` |
    `private static java.lang.String` | `PLUGIN_CHANGE_EVENT_MANAGER` |
    `private static java.lang.String` | `PLUGIN_CHANGE_EVENT_PLUGIN` |
    `private static java.lang.String` | `PLUGIN_CHANGE_EVENT_SOURCE` |
    `private java.lang.String[]` | `loadAfterNames` |
    `private java.lang.String[]` | `loadBeforeNames` |
    `private java.lang.String[]` | `observedPlugins` |
    `private groovy.lang.Closure` | `onChangeListener` |
    `private groovy.lang.Closure` | `onConfigChangeListener` |
    `private groovy.lang.Closure` | `onShutdownListener` |
    `private groovy.lang.GroovyObject` | `plugin` |
    `protected org.springframework.beans.BeanWrapper` | `pluginBean` |
    `private org.springframework.core.io.Resource` | `pluginDescriptor` |
    `private java.util.Map` | `pluginEnvs` |
    `private java.util.List<java.lang.String>` | `pluginExcludes` |
    `private GrailsPluginClass` | `pluginGrailsClass` |
    `private java.util.Collection` | `profiles` |
    `private java.lang.Class<?>[]` | `providedArtefacts` |
    `private org.springframework.core.io.support.PathMatchingResourcePatternResolver` | `resolver` |
    `private static long` | `serialVersionUID` |
    `private java.lang.String` | `status` |
    `private java.util.Collection<? extends org.springframework.core.type.filter.TypeFilter>` | `typeFilters` |
    `private java.lang.String[]` | `watchedResourcePatternReferences` |
    `private java.util.List<WatchPattern>` | `watchedResourcePatterns` |
    `private org.springframework.core.io.Resource[]` | `watchedResources` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class AbstractGrailsPlugin` | `DEFAULT_CONFIG_IGNORE_LIST, LOG, PLUGIN_GROOVY, PLUGIN_GROOVY_PATH, PLUGIN_YML, PLUGIN_YML_PATH, applicationContext, basePluginResource, config, dependencies, dependencyNames, evictionList, grailsApplication, isBase, manager, pluginClass, propertySource, version`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `DefaultGrailsPlugin (java.lang.Class<?> pluginClass, org.springframework.core.io.Resource resource, GrailsApplication application)`
    `DefaultGrailsPlugin (java.lang.Class<?> pluginClass, GrailsApplication application)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `private void` | `addBaseLocationPattern(java.util.List<java.lang.String> resourceList, java.lang.String baseLocation, java.lang.String pattern)`
    `` | `public void` | `addExclude(Environment env)`
    `` | `private void` | `addExcludeRuleInternal(java.util.Map map, java.lang.Object o)`
    `` | `public BeanBuilder` | `beans(groovy.lang.Closure closure)`
    `` | `public java.lang.Object` | `call(java.lang.Object arguments)`
    `` | `private void` | `callEvent(groovy.lang.Closure closureHook, java.util.Map event)`
    `` | `public void` | `doArtefactConfiguration()`
    `` | `public void` | `doWithApplicationContext(org.springframework.context.ApplicationContext ctx)`
    `` | `public void` | `doWithDynamicMethods(org.springframework.context.ApplicationContext ctx)`
    `` | `public void` | `doWithRuntimeConfiguration(RuntimeSpringConfiguration springConfig)`
    `` | `public void` | `doc(java.lang.String text)` deprecated: Dynamic document generation no longer supported
    `` | `private void` | `evaluateAndAddIncludeExcludeObject(java.util.Map targetMap, java.lang.Object includeExcludeObject, boolean include, groovy.lang.Closure converter)`
    `` | `private void` | `evaluateAndAddListOfValues(java.util.Map targetMap, java.util.List includeExcludeList, boolean include, groovy.lang.Closure converter)`
    `` | `private void` | `evaluateAndAddToIncludeExcludeSet(java.util.Map targetMap, java.lang.String includeExcludeString, boolean include, groovy.lang.Closure converter)`
    `` | `private java.util.Map` | `evaluateIncludeExcludeProperty(java.lang.String name, groovy.lang.Closure converter)`
    `` | `private void` | `evaluateObservedPlugins()`
    `` | `private void` | `evaluateOnChangeListener()`
    `` | `private void` | `evaluatePluginDependencies()`
    `` | `private void` | `evaluatePluginEvictionPolicy()`
    `` | `private void` | `evaluatePluginExcludes()`
    `` | `private void` | `evaluatePluginLoadAfters()`
    `` | `private void` | `evaluatePluginScopes()`
    `` | `private void` | `evaluatePluginStatus()`
    `` | `private void` | `evaluatePluginVersion()`
    `` | `private void` | `evaluateProfiles()`
    `` | `private void` | `evaluateProvidedArtefacts()`
    `` | `private void` | `evaluateTypeFilters()`
    `` | `public java.lang.String[]` | `getDependencyNames()`
    `` | `public java.lang.String` | `getDependentVersion(java.lang.String name)`
    `` | `public Resource` | `getDescriptor()`
    `` | `public java.lang.String` | `getFullName()`
    `` | `public groovy.lang.GroovyObject` | `getInstance()`
    `` | `public java.lang.String[]` | `getLoadAfterNames()`
    `` | `public java.lang.String[]` | `getLoadBeforeNames()`
    `` | `public org.apache.commons.logging.Log` | `getLog()`
    `` | `public java.lang.String` | `getName()`
    `` | `public java.lang.String[]` | `getObservedPluginNames()`
    `` | `public org.springframework.context.ApplicationContext` | `getParentCtx()`
    `` | `public GrailsPlugin` | `getPlugin()`
    `` | `public Resource` | `getPluginDir()`
    `` | `public java.util.List<java.lang.String>` | `getPluginExcludes()`
    `` | `public java.util.Map` | `getProperties()`
    `` | `public java.lang.Class<?>[]` | `getProvidedArtefacts()`
    `` | `public org.springframework.core.io.support.PathMatchingResourcePatternResolver` | `getResolver()` Returns: the resolver
    `` | `private java.lang.String` | `getResourcePatternForBaseLocation(java.lang.String baseLocation, java.lang.String resourcePath)`
    `` | `public java.util.Collection<? extends org.springframework.core.type.filter.TypeFilter>` | `getTypeFilters()`
    `` | `public java.util.List<WatchPattern>` | `getWatchedResourcePatterns()`
    `` | `public org.springframework.core.io.Resource[]` | `getWatchedResources()` Returns: the watchedResources
    `` | `public boolean` | `hasInterestInChange(java.lang.String path)`
    `` | `private void` | `initialisePlugin(java.lang.Class<?> clazz)`
    `` | `private void` | `invokeOnChangeListener(java.util.Map event)`
    `` | `private void` | `invokeOnConfigChangeListener(java.util.Map event)`
    `` | `private void` | `invokeOnShutdownEventListener(java.util.Map event)`
    `` | `private void` | `invokePluginHook(java.lang.String methodName, java.lang.Object[] args, org.springframework.context.ApplicationContext ctx)`
    `` | `public boolean` | `isEnabled(java.lang.String[] activeProfiles)`
    `` | `public boolean` | `isEnabled()`
    `` | `private java.util.Set` | `lazilyCreateIncludeOrExcludeSet(java.util.Map targetMap, boolean include)`
    `` | `public void` | `notifyOfEvent(java.util.Map event)`
    `` | `public java.util.Map` | `notifyOfEvent(int eventKind, java.lang.Object source)`
    `` | `public void` | `refresh()`
    `` | `public void` | `setApplicationContext(org.springframework.context.ApplicationContext applicationContext)`
    `` | `public void` | `setDescriptor(org.springframework.core.io.Resource descriptor)`
    `` | `public void` | `setManager(GrailsPluginManager manager)`
    `` | `public void` | `setParentApplicationContext(org.springframework.context.ApplicationContext parent)`
    `` | `public void` | `setWatchedResources(org.springframework.core.io.Resource[] watchedResources)`
    `` | `public boolean` | `supportsCurrentScopeAndEnvironment()`
    `` | `public boolean` | `supportsEnvironment(Environment environment)`
    `` | `private boolean` | `supportsValueInIncludeExcludeMap(java.util.Map includeExcludeMap, java.lang.Object value)`
    `` | `public java.lang.String` | `toString()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractGrailsPlugin` | `checkForChanges, compareTo, equals, getConfigurationResource, getDependencyNames, getDependentVersion, getEvictionNames, getFileSystemName, getFileSystemShortName, getLoadAfterNames, getLoadBeforeNames, getManager, getName, getPluginClass, getPluginPath, getPluginPathCamelCase, getPropertySource, getVersion, getWatchedResourcePatterns, hasInterestInChange, hashCode, isBasePlugin, isEnabled, readPluginConfiguration, refresh, setApplication, setApplicationContext, setBasePlugin, setManager`

- - ### Field Detail

    - #### private static final java.lang.String EXCLUDES

    - #### private static final java.lang.String INCLUDES

    - #### protected static final org.apache.commons.logging.Log LOG

    - #### private static final java.lang.String PLUGIN_CHANGE_EVENT_APPLICATION

    - #### private static final java.lang.String PLUGIN_CHANGE_EVENT_CTX

    - #### private static final java.lang.String PLUGIN_CHANGE_EVENT_MANAGER

    - #### private static final java.lang.String PLUGIN_CHANGE_EVENT_PLUGIN

    - #### private static final java.lang.String PLUGIN_CHANGE_EVENT_SOURCE

    - #### private java.lang.String[] loadAfterNames

    - #### private java.lang.String[] loadBeforeNames

    - #### private java.lang.String[] observedPlugins

    - #### private groovy.lang.Closure onChangeListener

    - #### private groovy.lang.Closure onConfigChangeListener

    - #### private groovy.lang.Closure onShutdownListener

    - #### private groovy.lang.GroovyObject plugin

    - #### protected org.springframework.beans.BeanWrapper pluginBean

    - #### private org.springframework.core.io.Resource pluginDescriptor

    - #### private java.util.Map pluginEnvs

    - #### private java.util.List<java.lang.String> pluginExcludes

    - #### private GrailsPluginClass pluginGrailsClass

    - #### private java.util.Collection profiles

    - #### private java.lang.Class<?>[] providedArtefacts

    - #### private org.springframework.core.io.support.PathMatchingResourcePatternResolver resolver

    - #### private static final long serialVersionUID

    - #### private java.lang.String status

    - #### private java.util.Collection<? extends org.springframework.core.type.filter.TypeFilter> typeFilters

    - #### private java.lang.String[] watchedResourcePatternReferences

    - #### private java.util.List<WatchPattern> watchedResourcePatterns

    - #### private org.springframework.core.io.Resource[] watchedResources

  - ### Constructor Detail

    - #### public DefaultGrailsPlugin(java.lang.Class<?> pluginClass, org.springframework.core.io.Resource resource, GrailsApplication application)

    - #### public DefaultGrailsPlugin(java.lang.Class<?> pluginClass, GrailsApplication application)

  - ### Method Detail

    - #### private void addBaseLocationPattern(java.util.List<java.lang.String> resourceList, java.lang.String baseLocation, java.lang.String pattern)

    - #### public void addExclude(Environment env)

    - #### @java.lang.SuppressWarnings("unchecked") private void addExcludeRuleInternal(java.util.Map map, java.lang.Object o)

    - #### public BeanBuilder beans(groovy.lang.Closure closure)

    - #### @java.lang.Override public java.lang.Object call(java.lang.Object arguments)

    - #### private void callEvent(groovy.lang.Closure closureHook, java.util.Map event)

    - #### public void doArtefactConfiguration()

    - #### public void doWithApplicationContext(org.springframework.context.ApplicationContext ctx)

    - #### public void doWithDynamicMethods(org.springframework.context.ApplicationContext ctx)

    - #### public void doWithRuntimeConfiguration(RuntimeSpringConfiguration springConfig)

    - #### @java.lang.Deprecated public void doc(java.lang.String text)

      deprecated:
        Dynamic document generation no longer supported
      Parameters:
        text

    - #### private void evaluateAndAddIncludeExcludeObject(java.util.Map targetMap, java.lang.Object includeExcludeObject, boolean include, groovy.lang.Closure converter)

    - #### private void evaluateAndAddListOfValues(java.util.Map targetMap, java.util.List includeExcludeList, boolean include, groovy.lang.Closure converter)

    - #### @java.lang.SuppressWarnings("unchecked") private void evaluateAndAddToIncludeExcludeSet(java.util.Map targetMap, java.lang.String includeExcludeString, boolean include, groovy.lang.Closure converter)

    - #### private java.util.Map evaluateIncludeExcludeProperty(java.lang.String name, groovy.lang.Closure converter)

    - #### private void evaluateObservedPlugins()

    - #### private void evaluateOnChangeListener()

    - #### @java.lang.SuppressWarnings("unchecked") private void evaluatePluginDependencies()

    - #### private void evaluatePluginEvictionPolicy()

    - #### @java.lang.SuppressWarnings("unchecked") private void evaluatePluginExcludes()

    - #### @java.lang.SuppressWarnings("unchecked") private void evaluatePluginLoadAfters()

    - #### private void evaluatePluginScopes()

    - #### private void evaluatePluginStatus()

    - #### private void evaluatePluginVersion()

    - #### private void evaluateProfiles()

    - #### @java.lang.SuppressWarnings("unchecked") private void evaluateProvidedArtefacts()

    - #### @java.lang.SuppressWarnings("unchecked") private void evaluateTypeFilters()

    - #### @java.lang.Override public java.lang.String[] getDependencyNames()

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

    - #### public Resource getDescriptor()

    - #### public java.lang.String getFullName()

    - #### public groovy.lang.GroovyObject getInstance()

    - #### @java.lang.Override public java.lang.String[] getLoadAfterNames()

    - #### @java.lang.Override public java.lang.String[] getLoadBeforeNames()

    - #### public org.apache.commons.logging.Log getLog()

    - #### @java.lang.Override public java.lang.String getName()

    - #### public java.lang.String[] getObservedPluginNames()

    - #### public org.springframework.context.ApplicationContext getParentCtx()

    - #### public GrailsPlugin getPlugin()

    - #### public Resource getPluginDir()

    - #### public java.util.List<java.lang.String> getPluginExcludes()

    - #### public java.util.Map getProperties()

    - #### public java.lang.Class<?>[] getProvidedArtefacts()

    - #### public org.springframework.core.io.support.PathMatchingResourcePatternResolver getResolver()

      Returns:
        the resolver

    - #### private java.lang.String getResourcePatternForBaseLocation(java.lang.String baseLocation, java.lang.String resourcePath)

    - #### public java.util.Collection<? extends org.springframework.core.type.filter.TypeFilter> getTypeFilters()

    - #### @java.lang.Override public java.util.List<WatchPattern> getWatchedResourcePatterns()

    - #### public org.springframework.core.io.Resource[] getWatchedResources()

      Returns:
        the watchedResources

    - #### @java.lang.Override public boolean hasInterestInChange(java.lang.String path)

    - #### private void initialisePlugin(java.lang.Class<?> clazz)

    - #### private void invokeOnChangeListener(java.util.Map event)

    - #### private void invokeOnConfigChangeListener(java.util.Map event)

    - #### private void invokeOnShutdownEventListener(java.util.Map event)

    - #### private void invokePluginHook(java.lang.String methodName, java.lang.Object[] args, org.springframework.context.ApplicationContext ctx)

    - #### @java.lang.Override public boolean isEnabled(java.lang.String[] activeProfiles)

    - #### public boolean isEnabled()

    - #### @java.lang.SuppressWarnings("unchecked") private java.util.Set lazilyCreateIncludeOrExcludeSet(java.util.Map targetMap, boolean include)

    - #### public void notifyOfEvent(java.util.Map event)

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

    - #### @java.lang.Override public void refresh()

    - #### @java.lang.Override public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)

    - #### public void setDescriptor(org.springframework.core.io.Resource descriptor)

    - #### @java.lang.Override public void setManager(GrailsPluginManager manager)

    - #### public void setParentApplicationContext(org.springframework.context.ApplicationContext parent)

    - #### public void setWatchedResources(org.springframework.core.io.Resource[] watchedResources)

    - #### public boolean supportsCurrentScopeAndEnvironment()

    - #### public boolean supportsEnvironment(Environment environment)

    - #### private boolean supportsValueInIncludeExcludeMap(java.util.Map includeExcludeMap, java.lang.Object value)

    - #### @java.lang.Override public java.lang.String toString()