public class DefaultBeanFactory extends Object implements BeanFactory
Constructor and Description |
---|
DefaultBeanFactory()
Constructs a new BeanFactory with a
DefaultBeanNameStrategy . |
DefaultBeanFactory(BeanNameStrategy namingStrategy,
BeanLoadingStrategy loadingStrategy) |
Modifier and Type | Method and Description |
---|---|
Object |
createAndAddBean(ClassLoader loader,
ApplicationContext applicationContext,
Class<?> klass)
Initializes an object of the given Class using the given
ClassLoader and adds the object to the given
ApplicationContext . |
Object |
load(ClassLoader classLoader,
Class<?> javaClass,
ApplicationContext ctx)
Load a bean, not adding it to the given
ApplicationContext . |
public DefaultBeanFactory()
DefaultBeanNameStrategy
.public DefaultBeanFactory(BeanNameStrategy namingStrategy, BeanLoadingStrategy loadingStrategy)
public Object createAndAddBean(ClassLoader loader, ApplicationContext applicationContext, Class<?> klass)
BeanFactory
ClassLoader
and adds the object to the given
ApplicationContext
.createAndAddBean
in interface BeanFactory
loader
- the ClassLoader to use.applicationContext
- the ApplicationContext
to put the bean in.klass
- the Class to load.public Object load(ClassLoader classLoader, Class<?> javaClass, ApplicationContext ctx)
BeanFactory
ApplicationContext
. But do try to set parameters and load
dependency beans.load
in interface BeanFactory
classLoader
- the ClassLoader to usejavaClass
- the class to loadctx
- the context to use for loading dependencies and settings member variables.Copyright © 2012 redlab.be. All Rights Reserved.