Package org.grails.spring
Class GrailsApplicationContext
- java.lang.Object
-
- org.springframework.core.io.DefaultResourceLoader
-
- org.springframework.context.support.AbstractApplicationContext
-
- org.springframework.context.support.GenericApplicationContext
-
- org.grails.spring.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.GroovyObjectAn 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
-
-
Field Summary
Fields Modifier and Type Field Description protected groovy.lang.MetaClassmetaClass-
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.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
-
-
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 voidassertBeanFactoryActive()booleancontainsBeanDefinition(java.lang.String beanName)groovy.lang.MetaClassgetMetaClass()java.lang.ObjectgetProperty(java.lang.String property)org.springframework.ui.context.ThemegetTheme(java.lang.String themeName)java.lang.ObjectinvokeMethod(java.lang.String name, java.lang.Object args)protected voidonRefresh()Initialize the theme capability.protected voidprepareBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)voidregisterPrototype(java.lang.String name, java.lang.Class<?> clazz)Register a prototype bean with the underlying bean factory.voidregisterPrototype(java.lang.String name, java.lang.Class<?> clazz, org.springframework.beans.MutablePropertyValues pvs)Register a prototype bean with the underlying bean factory.voidregisterSingleton(java.lang.String name, java.lang.Class<?> clazz)Register a singleton bean with the underlying bean factory.voidregisterSingleton(java.lang.String name, java.lang.Class<?> clazz, org.springframework.beans.MutablePropertyValues pvs)Register a singleton bean with the underlying bean factory.voidsetMetaClass(groovy.lang.MetaClass metaClass)voidsetProperty(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
-
-
-
-
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:
containsBeanDefinitionin interfaceorg.springframework.beans.factory.support.BeanDefinitionRegistry- Specified by:
containsBeanDefinitionin interfaceorg.springframework.beans.factory.ListableBeanFactory- Overrides:
containsBeanDefinitionin classorg.springframework.context.support.AbstractApplicationContext
-
getMetaClass
public groovy.lang.MetaClass getMetaClass()
- Specified by:
getMetaClassin interfacegroovy.lang.GroovyObject
-
getProperty
public java.lang.Object getProperty(java.lang.String property)
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject
-
invokeMethod
public java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)- Specified by:
invokeMethodin interfacegroovy.lang.GroovyObject
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass metaClass)
- Specified by:
setMetaClassin interfacegroovy.lang.GroovyObject
-
onRefresh
protected void onRefresh()
Initialize the theme capability.- Overrides:
onRefreshin classorg.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:
setPropertyin interfacegroovy.lang.GroovyObject
-
registerSingleton
public void registerSingleton(java.lang.String name, java.lang.Class<?> clazz) throws org.springframework.beans.BeansExceptionRegister 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.BeansExceptionRegister 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.BeansExceptionRegister 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.BeansExceptionRegister 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:
prepareBeanFactoryin classorg.springframework.context.support.AbstractApplicationContext
-
assertBeanFactoryActive
protected void assertBeanFactoryActive()
- Overrides:
assertBeanFactoryActivein classorg.springframework.context.support.AbstractApplicationContext
-
-