public class DefaultRuntimeSpringConfiguration extends java.lang.Object implements RuntimeSpringConfiguration
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
aliases |
protected org.springframework.beans.factory.ListableBeanFactory |
beanFactory |
protected java.lang.ClassLoader |
classLoader |
protected org.springframework.context.support.GenericApplicationContext |
context |
protected org.springframework.context.ApplicationContext |
parent |
| Constructor and Description |
|---|
DefaultRuntimeSpringConfiguration() |
DefaultRuntimeSpringConfiguration(org.springframework.context.ApplicationContext parent) |
DefaultRuntimeSpringConfiguration(org.springframework.context.ApplicationContext parent,
java.lang.ClassLoader cl) |
| Modifier and Type | Method and Description |
|---|---|
BeanConfiguration |
addAbstractBean(java.lang.String name)
\
Adds an abstract bean definition to the bean factory and returns the BeanConfiguration object.
|
void |
addAlias(java.lang.String alias,
java.lang.String beanName)
Adds an alias to a given bean name.
|
void |
addBeanConfiguration(java.lang.String beanName,
BeanConfiguration beanConfiguration)
Adds a bean configuration to the list of beans to be created.
|
void |
addBeanDefinition(java.lang.String name,
org.springframework.beans.factory.config.BeanDefinition bd)
Adds a Spring BeanDefinition.
|
BeanConfiguration |
addPrototypeBean(java.lang.String name)
Adds an empty prototype bean configuration.
|
BeanConfiguration |
addPrototypeBean(java.lang.String name,
java.lang.Class clazz)
Adds a prototype bean definition.
|
BeanConfiguration |
addSingletonBean(java.lang.String name)
Adds an empty singleton bean configuration.
|
BeanConfiguration |
addSingletonBean(java.lang.String name,
java.lang.Class clazz)
Adds a singleton bean definition.
|
BeanConfiguration |
addSingletonBean(java.lang.String name,
java.lang.Class clazz,
java.util.Collection args)
Creates a new singleton bean and adds it to the list of bean references.
|
boolean |
containsBean(java.lang.String name)
Returns whether the runtime spring config contains the specified bean.
|
protected org.springframework.context.support.GenericApplicationContext |
createApplicationContext(org.springframework.context.ApplicationContext parentCtx)
Creates the ApplicationContext instance.
|
org.springframework.beans.factory.support.AbstractBeanDefinition |
createBeanDefinition(java.lang.String name)
Creates and returns the BeanDefinition that is regsitered within the given name or returns null.
|
BeanConfiguration |
createPrototypeBean(java.lang.String name)
Creates a new prototype bean configuration.
|
BeanConfiguration |
createSingletonBean(java.lang.Class clazz)
Creates a singleton bean configuration.
|
BeanConfiguration |
createSingletonBean(java.lang.Class clazz,
java.util.Collection constructorArguments)
Creates a singleton bean configuration.
|
BeanConfiguration |
createSingletonBean(java.lang.String name)
Creates a new singleton bean configuration.
|
org.springframework.context.ApplicationContext |
getApplicationContext()
Retrieves the application context from the current state.
|
BeanConfiguration |
getBeanConfig(java.lang.String name)
Returns the BeanConfiguration for the specified name.
|
org.springframework.beans.factory.config.BeanDefinition |
getBeanDefinition(java.lang.String beanName)
Obtains a BeanDefinition instance for the given beanName.
|
java.util.List<java.lang.String> |
getBeanNames() |
org.springframework.context.ApplicationContext |
getUnrefreshedApplicationContext() |
protected void |
initialiseApplicationContext()
Initialises the ApplicationContext instance.
|
void |
registerBeansWithConfig(RuntimeSpringConfiguration targetSpringConfig)
Registers the beans held within this RuntimeSpringConfiguration instance with the given RuntimeSpringConfiguration.
|
void |
registerBeansWithContext(org.springframework.context.support.GenericApplicationContext applicationContext)
Registers the beans held within this RuntimeSpringConfiguration instance with the given ApplicationContext.
|
void |
registerBeansWithRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
Registers the beans held within this RuntimeSpringConfiguration instance with the given BeanDefinitionRegistry.
|
void |
registerPostProcessor(org.springframework.beans.factory.config.BeanFactoryPostProcessor processor)
Registers a bean factory post processor with the context.
|
void |
setBeanFactory(org.springframework.beans.factory.ListableBeanFactory beanFactory)
Sets the BeanFactory implementation to use.
|
protected org.springframework.context.support.GenericApplicationContext context
protected org.springframework.context.ApplicationContext parent
protected java.lang.ClassLoader classLoader
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> aliases
protected org.springframework.beans.factory.ListableBeanFactory beanFactory
public DefaultRuntimeSpringConfiguration()
public DefaultRuntimeSpringConfiguration(org.springframework.context.ApplicationContext parent)
public DefaultRuntimeSpringConfiguration(org.springframework.context.ApplicationContext parent,
java.lang.ClassLoader cl)
protected org.springframework.context.support.GenericApplicationContext createApplicationContext(org.springframework.context.ApplicationContext parentCtx)
parentCtx - The parent ApplicationContext instance. Can be null.protected void initialiseApplicationContext()
public BeanConfiguration addSingletonBean(java.lang.String name, java.lang.Class clazz)
RuntimeSpringConfigurationaddSingletonBean in interface RuntimeSpringConfigurationname - The name of the beanclazz - The class of the beanpublic BeanConfiguration addPrototypeBean(java.lang.String name, java.lang.Class clazz)
RuntimeSpringConfigurationaddPrototypeBean in interface RuntimeSpringConfigurationname - The name of the beanclazz - The class of the beanpublic org.springframework.context.ApplicationContext getApplicationContext()
RuntimeSpringConfigurationgetApplicationContext in interface RuntimeSpringConfigurationpublic org.springframework.context.ApplicationContext getUnrefreshedApplicationContext()
getUnrefreshedApplicationContext in interface RuntimeSpringConfigurationpublic BeanConfiguration addSingletonBean(java.lang.String name)
RuntimeSpringConfigurationaddSingletonBean in interface RuntimeSpringConfigurationname - The name of the singleton beanpublic BeanConfiguration createSingletonBean(java.lang.Class clazz)
RuntimeSpringConfigurationcreateSingletonBean in interface RuntimeSpringConfigurationpublic BeanConfiguration addSingletonBean(java.lang.String name, java.lang.Class clazz, java.util.Collection args)
RuntimeSpringConfigurationaddSingletonBean in interface RuntimeSpringConfigurationname - The name of the beanclazz - The class of the beanargs - The constructor arguments of the beanpublic BeanConfiguration addPrototypeBean(java.lang.String name)
RuntimeSpringConfigurationaddPrototypeBean in interface RuntimeSpringConfigurationname - The name of the prototype beanpublic BeanConfiguration createSingletonBean(java.lang.Class clazz, java.util.Collection constructorArguments)
RuntimeSpringConfigurationcreateSingletonBean in interface RuntimeSpringConfigurationclazz - The bean classconstructorArguments - The constructor argumentspublic BeanConfiguration createPrototypeBean(java.lang.String name)
RuntimeSpringConfigurationcreatePrototypeBean in interface RuntimeSpringConfigurationname - The bean namepublic BeanConfiguration createSingletonBean(java.lang.String name)
RuntimeSpringConfigurationcreateSingletonBean in interface RuntimeSpringConfigurationname - The bean namepublic void addBeanConfiguration(java.lang.String beanName,
BeanConfiguration beanConfiguration)
RuntimeSpringConfigurationaddBeanConfiguration in interface RuntimeSpringConfigurationbeanName - The name of the bean in the contextbeanConfiguration - The BeanConfiguration instancepublic void addBeanDefinition(java.lang.String name,
org.springframework.beans.factory.config.BeanDefinition bd)
RuntimeSpringConfigurationaddBeanDefinition in interface RuntimeSpringConfigurationname - The name of the beanbd - The BeanDefinition instancepublic boolean containsBean(java.lang.String name)
RuntimeSpringConfigurationcontainsBean in interface RuntimeSpringConfigurationname - The bean namepublic BeanConfiguration getBeanConfig(java.lang.String name)
RuntimeSpringConfigurationgetBeanConfig in interface RuntimeSpringConfigurationname - The name of the bean configurationpublic org.springframework.beans.factory.support.AbstractBeanDefinition createBeanDefinition(java.lang.String name)
RuntimeSpringConfigurationcreateBeanDefinition in interface RuntimeSpringConfigurationname - The name of the bean definitionpublic void registerPostProcessor(org.springframework.beans.factory.config.BeanFactoryPostProcessor processor)
RuntimeSpringConfigurationregisterPostProcessor in interface RuntimeSpringConfigurationprocessor - The BeanFactoryPostProcessor instancepublic java.util.List<java.lang.String> getBeanNames()
getBeanNames in interface RuntimeSpringConfigurationpublic void registerBeansWithContext(org.springframework.context.support.GenericApplicationContext applicationContext)
RuntimeSpringConfigurationregisterBeansWithContext in interface RuntimeSpringConfigurationapplicationContext - The ApplicationContext instancepublic void registerBeansWithRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
RuntimeSpringConfigurationregisterBeansWithRegistry in interface RuntimeSpringConfigurationregistry - The BeanDefinitionRegistry instancepublic void registerBeansWithConfig(RuntimeSpringConfiguration targetSpringConfig)
RuntimeSpringConfigurationregisterBeansWithConfig in interface RuntimeSpringConfigurationtargetSpringConfig - The RuntimeSpringConfiguration instancepublic BeanConfiguration addAbstractBean(java.lang.String name)
RuntimeSpringConfigurationaddAbstractBean in interface RuntimeSpringConfigurationname - The name of the beanpublic void addAlias(java.lang.String alias,
java.lang.String beanName)
RuntimeSpringConfigurationaddAlias in interface RuntimeSpringConfigurationalias - The aliasbeanName - The beanpublic org.springframework.beans.factory.config.BeanDefinition getBeanDefinition(java.lang.String beanName)
RuntimeSpringConfigurationgetBeanDefinition in interface RuntimeSpringConfigurationbeanName - The beanNamepublic void setBeanFactory(org.springframework.beans.factory.ListableBeanFactory beanFactory)
RuntimeSpringConfigurationsetBeanFactory in interface RuntimeSpringConfigurationbeanFactory - The BeanFactory implementation