use of grails.plugins.GrailsPluginManager in project grails-core by grails.
the class ClosureClassIgnoringComponentScanBeanDefinitionParser method createScanner.
@Override
protected ClassPathBeanDefinitionScanner createScanner(XmlReaderContext readerContext, boolean useDefaultFilters) {
final ClassPathBeanDefinitionScanner scanner = super.createScanner(readerContext, useDefaultFilters);
BeanDefinitionRegistry beanDefinitionRegistry = readerContext.getRegistry();
GrailsPluginManager pluginManager = null;
if (beanDefinitionRegistry instanceof HierarchicalBeanFactory) {
HierarchicalBeanFactory beanFactory = (HierarchicalBeanFactory) beanDefinitionRegistry;
BeanFactory parent = beanFactory.getParentBeanFactory();
if (parent != null && parent.containsBean(GrailsPluginManager.BEAN_NAME)) {
pluginManager = parent.getBean(GrailsPluginManager.BEAN_NAME, GrailsPluginManager.class);
}
}
if (pluginManager != null) {
List<TypeFilter> typeFilters = pluginManager.getTypeFilters();
for (TypeFilter typeFilter : typeFilters) {
scanner.addIncludeFilter(typeFilter);
}
}
return scanner;
}
use of grails.plugins.GrailsPluginManager in project grails-core by grails.
the class GroovyPageMetaInfo method initializePluginPath.
private void initializePluginPath() {
if (grailsApplication == null || pageClass == null) {
return;
}
final ApplicationContext applicationContext = grailsApplication.getMainContext();
if (applicationContext == null || !applicationContext.containsBean(GrailsPluginManager.BEAN_NAME)) {
return;
}
GrailsPluginManager pluginManager = applicationContext.getBean(GrailsPluginManager.BEAN_NAME, GrailsPluginManager.class);
pluginPath = pluginManager.getPluginPathForClass(pageClass);
if (pluginPath == null)
pluginPath = DEFAULT_PLUGIN_PATH;
pagePlugin = pluginManager.getPluginForClass(pageClass);
}
use of grails.plugins.GrailsPluginManager in project grails-core by grails.
the class Holders method currentPluginManager.
public static GrailsPluginManager currentPluginManager() {
GrailsPluginManager current = getPluginManager();
Assert.notNull(current, "No PluginManager set");
return current;
}
Aggregations