Groovy Documentation

## org.codehaus.groovy.grails.commons.spring
[Java] Class DefaultRuntimeSpringConfiguration

    java.lang.Object
      org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration

All Implemented Interfaces:
  RuntimeSpringConfiguration

    public class DefaultRuntimeSpringConfiguration

A programmable runtime Spring configuration that allows a spring ApplicationContext to be constructed at runtime. Credit must go to Solomon Duskis and the article: http://jroller.com/page/Solomon?entry=programmatic_configuration_in_spring

Authors:
  Graeme

Since:
  0.3

Field Summary
`protected java.util.Map` | `aliases`
`protected ListableBeanFactory` | `beanFactory`
`protected java.lang.ClassLoader` | `classLoader`
`protected GenericApplicationContext` | `context`
`protected ApplicationContext` | `parent`

Constructor Summary
`DefaultRuntimeSpringConfiguration()`
`DefaultRuntimeSpringConfiguration(ApplicationContext parent)`
`DefaultRuntimeSpringConfiguration(ApplicationContext parent, java.lang.ClassLoader cl)`

Method Summary
`BeanConfiguration` | `addAbstractBean(java.lang.String name)`
`void` | `addAlias(java.lang.String alias, java.lang.String beanName)`
`void` | `addBeanConfiguration(java.lang.String beanName, BeanConfiguration beanConfiguration)`
`void` | `addBeanDefinition(java.lang.String name, BeanDefinition bd)`
`BeanConfiguration` | `addPrototypeBean(java.lang.String name, java.lang.Class clazz)`
`BeanConfiguration` | `addPrototypeBean(java.lang.String name)`
`BeanConfiguration` | `addSingletonBean(java.lang.String name, java.lang.Class clazz)`
`BeanConfiguration` | `addSingletonBean(java.lang.String name)`
`BeanConfiguration` | `addSingletonBean(java.lang.String name, java.lang.Class clazz, java.util.Collection args)`
`boolean` | `containsBean(java.lang.String name)`
`protected GenericApplicationContext` | `createApplicationContext(ApplicationContext parentCtx)` Creates the ApplicationContext instance.
`AbstractBeanDefinition` | `createBeanDefinition(java.lang.String name)`
`BeanConfiguration` | `createPrototypeBean(java.lang.String name)`
`BeanConfiguration` | `createSingletonBean(java.lang.Class clazz)`
`BeanConfiguration` | `createSingletonBean(java.lang.Class clazz, java.util.Collection constructorArguments)`
`BeanConfiguration` | `createSingletonBean(java.lang.String name)`
`ApplicationContext` | `getApplicationContext()`
`BeanConfiguration` | `getBeanConfig(java.lang.String name)`
`BeanDefinition` | `getBeanDefinition(java.lang.String beanName)`
`java.util.List` | `getBeanNames()`
`ApplicationContext` | `getUnrefreshedApplicationContext()`
`protected void` | `initialiseApplicationContext()` Initialises the ApplicationContext instance.
`void` | `registerBeansWithConfig(RuntimeSpringConfiguration targetSpringConfig)`
`void` | `registerBeansWithContext(GenericApplicationContext applicationContext)`
`void` | `registerBeansWithRegistry(BeanDefinitionRegistry registry)`
`void` | `registerPostProcessor(BeanFactoryPostProcessor processor)`
`void` | `setBeanFactory(ListableBeanFactory beanFactory)`

Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### aliases

    protected java.util.Map aliases

### beanFactory

    protected ListableBeanFactory beanFactory

### classLoader

    protected java.lang.ClassLoader classLoader

### context

    protected GenericApplicationContext context

### parent

    protected ApplicationContext parent

Constructor Detail

### DefaultRuntimeSpringConfiguration

    public DefaultRuntimeSpringConfiguration()

### DefaultRuntimeSpringConfiguration

    public DefaultRuntimeSpringConfiguration(ApplicationContext parent)

### DefaultRuntimeSpringConfiguration

    public DefaultRuntimeSpringConfiguration(ApplicationContext parent, java.lang.ClassLoader cl)

Method Detail

### addAbstractBean

    public BeanConfiguration addAbstractBean(java.lang.String name)

### addAlias

    public void addAlias(java.lang.String alias, java.lang.String beanName)

### addBeanConfiguration

    public void addBeanConfiguration(java.lang.String beanName, BeanConfiguration beanConfiguration)

### addBeanDefinition

    public void addBeanDefinition(java.lang.String name, BeanDefinition bd)

### addPrototypeBean

    public BeanConfiguration addPrototypeBean(java.lang.String name, @SuppressWarnings("rawtypes") java.lang.Class clazz)

### addPrototypeBean

    public BeanConfiguration addPrototypeBean(java.lang.String name)

### addSingletonBean

    public BeanConfiguration addSingletonBean(java.lang.String name, @SuppressWarnings("rawtypes") java.lang.Class clazz)

### addSingletonBean

    public BeanConfiguration addSingletonBean(java.lang.String name)

### addSingletonBean

    @SuppressWarnings("rawtypes")
    public BeanConfiguration addSingletonBean(java.lang.String name, java.lang.Class clazz, java.util.Collection args)

### containsBean

    public boolean containsBean(java.lang.String name)

### createApplicationContext

    protected GenericApplicationContext createApplicationContext(ApplicationContext parentCtx)

  Creates the ApplicationContext instance. Subclasses can override to customise the used ApplicationContext
  Parameters:
    `parent` - The parent ApplicationContext instance. Can be null.
  Returns:
    An instance of GenericApplicationContext

### createBeanDefinition

    public AbstractBeanDefinition createBeanDefinition(java.lang.String name)

### createPrototypeBean

    public BeanConfiguration createPrototypeBean(java.lang.String name)

### createSingletonBean

    public BeanConfiguration createSingletonBean(@SuppressWarnings("rawtypes") java.lang.Class clazz)

### createSingletonBean

    @SuppressWarnings("rawtypes")
    public BeanConfiguration createSingletonBean(java.lang.Class clazz, java.util.Collection constructorArguments)

### createSingletonBean

    public BeanConfiguration createSingletonBean(java.lang.String name)

### getApplicationContext

    public ApplicationContext getApplicationContext()

### getBeanConfig

    public BeanConfiguration getBeanConfig(java.lang.String name)

### getBeanDefinition

    public BeanDefinition getBeanDefinition(java.lang.String beanName)

### getBeanNames

    public java.util.List getBeanNames()

### getUnrefreshedApplicationContext

    public ApplicationContext getUnrefreshedApplicationContext()

### initialiseApplicationContext

    protected void initialiseApplicationContext()

  Initialises the ApplicationContext instance.

### registerBeansWithConfig

    public void registerBeansWithConfig(RuntimeSpringConfiguration targetSpringConfig)

### registerBeansWithContext

    public void registerBeansWithContext(GenericApplicationContext applicationContext)

### registerBeansWithRegistry

    public void registerBeansWithRegistry(BeanDefinitionRegistry registry)

### registerPostProcessor

    public void registerPostProcessor(BeanFactoryPostProcessor processor)

### setBeanFactory

    public void setBeanFactory(ListableBeanFactory beanFactory)

Groovy Documentation