Class GrailsApplicationContext

  • All Implemented Interfaces:
    groovy.lang.GroovyObject, java.io.Closeable, java.lang.AutoCloseable, org.springframework.beans.factory.BeanFactory, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.beans.factory.support.BeanDefinitionRegistry, org.springframework.context.ApplicationContext, org.springframework.context.ApplicationEventPublisher, org.springframework.context.ConfigurableApplicationContext, org.springframework.context.Lifecycle, org.springframework.context.MessageSource, org.springframework.core.AliasRegistry, org.springframework.core.env.EnvironmentCapable, org.springframework.core.io.ResourceLoader, org.springframework.core.io.support.ResourcePatternResolver

    public class GrailsApplicationContext
    extends org.springframework.context.support.GenericApplicationContext
    implements groovy.lang.GroovyObject
    An ApplicationContext that extends StaticApplicationContext and implements GroovyObject such that beans can be retrieved with the dot de-reference syntax instead of using getBean('name').
    Since:
    1.0
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.springframework.core.io.DefaultResourceLoader

        org.springframework.core.io.DefaultResourceLoader.ClassPathContextResource
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected groovy.lang.MetaClass metaClass  
      • Fields inherited from class org.springframework.context.support.AbstractApplicationContext

        APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
      • Fields inherited from interface org.springframework.beans.factory.BeanFactory

        FACTORY_BEAN_PREFIX
      • Fields inherited from interface org.springframework.context.ConfigurableApplicationContext

        APPLICATION_STARTUP_BEAN_NAME, CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, ENVIRONMENT_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SHUTDOWN_HOOK_THREAD_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
      • Fields inherited from interface org.springframework.core.io.ResourceLoader

        CLASSPATH_URL_PREFIX
      • Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver

        CLASSPATH_ALL_URL_PREFIX
    • Constructor Summary

      Constructors 
      Constructor Description
      GrailsApplicationContext()  
      GrailsApplicationContext​(org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory)  
      GrailsApplicationContext​(org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory, org.springframework.context.ApplicationContext applicationContext)  
      GrailsApplicationContext​(org.springframework.context.ApplicationContext parent)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void assertBeanFactoryActive()  
      boolean containsBeanDefinition​(java.lang.String beanName)  
      groovy.lang.MetaClass getMetaClass()  
      java.lang.Object getProperty​(java.lang.String property)  
      org.springframework.ui.context.Theme getTheme​(java.lang.String themeName)  
      java.lang.Object invokeMethod​(java.lang.String name, java.lang.Object args)  
      protected void onRefresh()
      Initialize the theme capability.
      protected void prepareBeanFactory​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)  
      void registerPrototype​(java.lang.String name, java.lang.Class<?> clazz)
      Register a prototype bean with the underlying bean factory.
      void registerPrototype​(java.lang.String name, java.lang.Class<?> clazz, org.springframework.beans.MutablePropertyValues pvs)
      Register a prototype bean with the underlying bean factory.
      void registerSingleton​(java.lang.String name, java.lang.Class<?> clazz)
      Register a singleton bean with the underlying bean factory.
      void registerSingleton​(java.lang.String name, java.lang.Class<?> clazz, org.springframework.beans.MutablePropertyValues pvs)
      Register a singleton bean with the underlying bean factory.
      void setMetaClass​(groovy.lang.MetaClass metaClass)  
      void setProperty​(java.lang.String property, java.lang.Object newValue)  
      • Methods inherited from class org.springframework.context.support.GenericApplicationContext

        cancelRefresh, closeBeanFactory, getAutowireCapableBeanFactory, getBeanDefinition, getBeanFactory, getClassLoader, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanNameInUse, refreshBeanFactory, registerAlias, registerBean, registerBean, registerBean, registerBean, registerBean, registerBean, registerBeanDefinition, removeAlias, removeBeanDefinition, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setApplicationStartup, setClassLoader, setParent, setResourceLoader
      • Methods inherited from class org.springframework.context.support.AbstractApplicationContext

        addApplicationListener, addBeanFactoryPostProcessor, close, containsBean, containsLocalBean, createEnvironment, destroy, destroyBeans, doClose, findAnnotationOnBean, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getApplicationName, getApplicationStartup, getBean, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getEnvironment, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getStartupDate, getType, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, initPropertySources, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, isTypeMatch, obtainFreshBeanFactory, onClose, postProcessBeanFactory, prepareRefresh, publishEvent, publishEvent, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, resetCommonCaches, setDisplayName, setEnvironment, setId, start, stop, toString
      • Methods inherited from class org.springframework.core.io.DefaultResourceLoader

        addProtocolResolver, clearResourceCaches, getProtocolResolvers, getResourceByPath, getResourceCache
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.springframework.core.AliasRegistry

        getAliases
      • Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry

        getBeanDefinitionCount, getBeanDefinitionNames
      • Methods inherited from interface org.springframework.context.ConfigurableApplicationContext

        addProtocolResolver
    • Field Detail

      • metaClass

        protected groovy.lang.MetaClass metaClass
    • Constructor Detail

      • GrailsApplicationContext

        public GrailsApplicationContext​(org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory)
      • GrailsApplicationContext

        public GrailsApplicationContext​(org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory,
                                        org.springframework.context.ApplicationContext applicationContext)
      • GrailsApplicationContext

        public GrailsApplicationContext​(org.springframework.context.ApplicationContext parent)
                                 throws org.springframework.beans.BeansException
        Throws:
        org.springframework.beans.BeansException
      • GrailsApplicationContext

        public GrailsApplicationContext()
                                 throws org.springframework.beans.BeansException
        Throws:
        org.springframework.beans.BeansException
    • Method Detail

      • containsBeanDefinition

        public boolean containsBeanDefinition​(java.lang.String beanName)
        Specified by:
        containsBeanDefinition in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
        Specified by:
        containsBeanDefinition in interface org.springframework.beans.factory.ListableBeanFactory
        Overrides:
        containsBeanDefinition in class org.springframework.context.support.AbstractApplicationContext
      • getMetaClass

        public groovy.lang.MetaClass getMetaClass()
        Specified by:
        getMetaClass in interface groovy.lang.GroovyObject
      • getProperty

        public java.lang.Object getProperty​(java.lang.String property)
        Specified by:
        getProperty in interface groovy.lang.GroovyObject
      • invokeMethod

        public java.lang.Object invokeMethod​(java.lang.String name,
                                             java.lang.Object args)
        Specified by:
        invokeMethod in interface groovy.lang.GroovyObject
      • setMetaClass

        public void setMetaClass​(groovy.lang.MetaClass metaClass)
        Specified by:
        setMetaClass in interface groovy.lang.GroovyObject
      • onRefresh

        protected void onRefresh()
        Initialize the theme capability.
        Overrides:
        onRefresh in class org.springframework.context.support.AbstractApplicationContext
      • getTheme

        public org.springframework.ui.context.Theme getTheme​(java.lang.String themeName)
      • setProperty

        public void setProperty​(java.lang.String property,
                                java.lang.Object newValue)
        Specified by:
        setProperty in interface groovy.lang.GroovyObject
      • registerSingleton

        public void registerSingleton​(java.lang.String name,
                                      java.lang.Class<?> clazz)
                               throws org.springframework.beans.BeansException
        Register a singleton bean with the underlying bean factory.

        For more advanced needs, register with the underlying BeanFactory directly.

        Throws:
        org.springframework.beans.BeansException
        See Also:
        GenericApplicationContext.getDefaultListableBeanFactory()
      • registerSingleton

        public void registerSingleton​(java.lang.String name,
                                      java.lang.Class<?> clazz,
                                      org.springframework.beans.MutablePropertyValues pvs)
                               throws org.springframework.beans.BeansException
        Register a singleton bean with the underlying bean factory.

        For more advanced needs, register with the underlying BeanFactory directly.

        Throws:
        org.springframework.beans.BeansException
        See Also:
        GenericApplicationContext.getDefaultListableBeanFactory()
      • registerPrototype

        public void registerPrototype​(java.lang.String name,
                                      java.lang.Class<?> clazz)
                               throws org.springframework.beans.BeansException
        Register a prototype bean with the underlying bean factory.

        For more advanced needs, register with the underlying BeanFactory directly.

        Throws:
        org.springframework.beans.BeansException
        See Also:
        GenericApplicationContext.getDefaultListableBeanFactory()
      • registerPrototype

        public void registerPrototype​(java.lang.String name,
                                      java.lang.Class<?> clazz,
                                      org.springframework.beans.MutablePropertyValues pvs)
                               throws org.springframework.beans.BeansException
        Register a prototype bean with the underlying bean factory.

        For more advanced needs, register with the underlying BeanFactory directly.

        Throws:
        org.springframework.beans.BeansException
        See Also:
        GenericApplicationContext.getDefaultListableBeanFactory()
      • prepareBeanFactory

        protected void prepareBeanFactory​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
        Overrides:
        prepareBeanFactory in class org.springframework.context.support.AbstractApplicationContext
      • assertBeanFactoryActive

        protected void assertBeanFactoryActive()
        Overrides:
        assertBeanFactoryActive in class org.springframework.context.support.AbstractApplicationContext