|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RuntimeSpringConfiguration
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
Method Summary | |
---|---|
BeanConfiguration |
addAbstractBean(String name)
Adds an abstract bean definition to the bean factory and returns the BeanConfiguration object |
void |
addAlias(String alias,
String beanName)
Adds an alias to a given bean name |
void |
addBeanConfiguration(String beanName,
BeanConfiguration beanConfiguration)
Adds a bean configuration to the list of beans to be created |
void |
addBeanDefinition(String name,
BeanDefinition bd)
Adds a Spring BeanDefinition. |
BeanConfiguration |
addPrototypeBean(String name)
Adds an empty prototype bean configuration |
BeanConfiguration |
addPrototypeBean(String name,
Class clazz)
Adds a prototype bean definition |
BeanConfiguration |
addSingletonBean(String name)
Adds an empty singleton bean configuration |
BeanConfiguration |
addSingletonBean(String name,
Class clazz)
Adds a singleton bean definition |
BeanConfiguration |
addSingletonBean(String name,
Class clazz,
Collection args)
Creates a new singleton bean and adds it to the list of bean references |
boolean |
containsBean(String name)
Returns whether the runtime spring config contains the specified bean |
AbstractBeanDefinition |
createBeanDefinition(String name)
Creates and returns the BeanDefinition that is regsitered within the given name or returns null |
BeanConfiguration |
createPrototypeBean(String name)
Creates a new prototype bean configuration. |
BeanConfiguration |
createSingletonBean(Class clazz)
Creates a singleton bean configuration. |
BeanConfiguration |
createSingletonBean(Class clazz,
Collection constructorArguments)
Creates a singleton bean configuration. |
BeanConfiguration |
createSingletonBean(String name)
Creates a new singleton bean configuration. |
ApplicationContext |
getApplicationContext()
Retrieves the application context from the current state |
BeanConfiguration |
getBeanConfig(String name)
Returns the BeanConfiguration for the specified name |
BeanDefinition |
getBeanDefinition(String beanName)
Obtains a BeanDefinition instance for the given beanName |
List |
getBeanNames()
|
ApplicationContext |
getUnrefreshedApplicationContext()
|
void |
registerBeansWithConfig(RuntimeSpringConfiguration targetSpringConfig)
Registers the beans held within this RuntimeSpringConfiguration instance with the given RuntimeSpringConfiguration |
void |
registerBeansWithContext(GenericApplicationContext applicationContext)
Registers the beans held within this RuntimeSpringConfiguration instance with the given ApplicationContext |
void |
registerBeansWithRegistry(BeanDefinitionRegistry registry)
Registers the beans held within this RuntimeSpringConfiguration instance with the given BeanDefinitionRegistry |
void |
registerPostProcessor(BeanFactoryPostProcessor processor)
Registers a bean factory post processor with the context |
void |
setBeanFactory(ListableBeanFactory beanFactory)
Sets the BeanFactory implementation to use |
Method Detail |
---|
BeanConfiguration addSingletonBean(String name, Class clazz)
name
- The name of the beanclazz
- The class of the bean
ApplicationContext getUnrefreshedApplicationContext()
BeanConfiguration addPrototypeBean(String name, Class clazz)
name
- The name of the beanclazz
- The class of the bean
ApplicationContext getApplicationContext()
BeanConfiguration addSingletonBean(String name)
name
- The name of the singleton bean
BeanConfiguration addPrototypeBean(String name)
name
- The name of the prototype bean
BeanConfiguration createSingletonBean(Class clazz)
clazz
-
BeanConfiguration addSingletonBean(String name, Class clazz, Collection args)
name
- The name of the beanclazz
- The class of the beanargs
- The constructor arguments of the bean
BeanConfiguration createSingletonBean(Class clazz, Collection constructorArguments)
clazz
- The bean classconstructorArguments
- The constructor arguments
BeanConfiguration createPrototypeBean(String name)
name
- The bean name
BeanConfiguration createSingletonBean(String name)
name
- The bean name
void addBeanConfiguration(String beanName, BeanConfiguration beanConfiguration)
beanName
- The name of the bean in the contextbeanConfiguration
- The BeanConfiguration instancevoid addBeanDefinition(String name, BeanDefinition bd)
name
- The name of the beanbd
- The BeanDefinition instanceboolean containsBean(String name)
name
- The bean name
BeanConfiguration getBeanConfig(String name)
name
- The name of the bean configuration
AbstractBeanDefinition createBeanDefinition(String name)
name
- The name of the bean definition
void registerPostProcessor(BeanFactoryPostProcessor processor)
processor
- The BeanFactoryPostProcessor instanceList getBeanNames()
void registerBeansWithContext(GenericApplicationContext applicationContext)
applicationContext
- The ApplicationContext instancevoid registerBeansWithRegistry(BeanDefinitionRegistry registry)
registry
- The BeanDefinitionRegistry instancevoid registerBeansWithConfig(RuntimeSpringConfiguration targetSpringConfig)
targetSpringConfig
- The RuntimeSpringConfiguration instanceBeanConfiguration addAbstractBean(String name)
name
- The name of the bean
void addAlias(String alias, String beanName)
alias
- The aliasbeanName
- The beanBeanDefinition getBeanDefinition(String beanName)
beanName
- The beanName
void setBeanFactory(ListableBeanFactory beanFactory)
beanFactory
- The BeanFactory implementation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |