Search in sources :

Example 1 with GrailsApplicationAware

use of grails.core.support.GrailsApplicationAware in project grails-core by grails.

the class DefaultGrailsPlugin method initialisePlugin.

private void initialisePlugin(Class<?> clazz) {
    pluginGrailsClass = new GrailsPluginClass(clazz);
    plugin = (GroovyObject) pluginGrailsClass.newInstance();
    if (plugin instanceof Plugin) {
        Plugin p = (Plugin) plugin;
        p.setApplicationContext(applicationContext);
        p.setPlugin(this);
        p.setGrailsApplication(grailsApplication);
        p.setPluginManager(manager);
    } else if (plugin instanceof GrailsApplicationAware) {
        ((GrailsApplicationAware) plugin).setGrailsApplication(grailsApplication);
    }
    pluginBean = new BeanWrapperImpl(plugin);
    // configure plugin
    evaluatePluginVersion();
    evaluatePluginDependencies();
    evaluatePluginLoadAfters();
    evaluateProvidedArtefacts();
    evaluatePluginEvictionPolicy();
    evaluateOnChangeListener();
    evaluateObservedPlugins();
    evaluatePluginStatus();
    evaluatePluginScopes();
    evaluatePluginExcludes();
    evaluateTypeFilters();
}
Also used : BeanWrapperImpl(org.springframework.beans.BeanWrapperImpl) GrailsApplicationAware(grails.core.support.GrailsApplicationAware) GrailsPlugin(grails.plugins.GrailsPlugin) Plugin(grails.plugins.Plugin)

Aggregations

GrailsApplicationAware (grails.core.support.GrailsApplicationAware)1 GrailsPlugin (grails.plugins.GrailsPlugin)1 Plugin (grails.plugins.Plugin)1 BeanWrapperImpl (org.springframework.beans.BeanWrapperImpl)1