Class AbstractBeanRegistry
- java.lang.Object
-
- com.aspectran.core.component.AbstractComponent
-
- com.aspectran.core.component.bean.AbstractBeanFactory
-
- com.aspectran.core.component.bean.AbstractBeanRegistry
-
- All Implemented Interfaces:
BeanRegistry
,Component
- Direct Known Subclasses:
ContextBeanRegistry
public abstract class AbstractBeanRegistry extends AbstractBeanFactory implements BeanRegistry
The Class AbstractBeanRegistry.Created: 2009. 03. 09 PM 23:48:09
-
-
Constructor Summary
Constructors Constructor Description AbstractBeanRegistry(ActivityContext context, BeanRuleRegistry beanRuleRegistry, BeanProxifierType beanProxifierType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
containsBean(java.lang.Class<?> requiredType)
Return whether a bean with the specified object type is present.boolean
containsBean(java.lang.String id)
Return whether a bean with the specified id is present.protected abstract <T> T
getBean(BeanRule beanRule)
<T> T
getBean(java.lang.Class<T> requiredType)
Returns the bean instance that uniquely matches the given object type.<T> T
getBean(java.lang.Class<T> requiredType, java.lang.String id)
Returns an instance of the bean that matches the given object type.<T> T
getBean(java.lang.String id)
Returns an instance of the bean that matches the given id.<T> T
getBean(java.lang.String id, java.lang.Class<T> requiredType)
Returns an instance of the bean that matches the given id.<T> T
getBeanForConfig(java.lang.Class<T> requiredType)
Returns the bean instance used for the annotated configuration that matches the specified object type.-
Methods inherited from class com.aspectran.core.component.bean.AbstractBeanFactory
createBean, doDestroy, doInitialize, getBeanRuleRegistry, getContext, getFactoryProducedObject
-
Methods inherited from class com.aspectran.core.component.AbstractComponent
destroy, getComponentName, initialize, isAvailable, isDestroyed, isInitialized
-
-
-
-
Constructor Detail
-
AbstractBeanRegistry
public AbstractBeanRegistry(ActivityContext context, BeanRuleRegistry beanRuleRegistry, BeanProxifierType beanProxifierType)
-
-
Method Detail
-
getBean
public <T> T getBean(java.lang.String id)
Description copied from interface:BeanRegistry
Returns an instance of the bean that matches the given id.- Specified by:
getBean
in interfaceBeanRegistry
- Type Parameters:
T
- the generic type- Parameters:
id
- the id of the bean to retrieve- Returns:
- an instance of the bean
-
getBean
public <T> T getBean(java.lang.Class<T> requiredType)
Description copied from interface:BeanRegistry
Returns the bean instance that uniquely matches the given object type.- Specified by:
getBean
in interfaceBeanRegistry
- Type Parameters:
T
- the generic type- Parameters:
requiredType
- the type the bean must match; can be an interface or superclass- Returns:
- an instance of the bean
-
getBean
public <T> T getBean(java.lang.String id, java.lang.Class<T> requiredType)
Description copied from interface:BeanRegistry
Returns an instance of the bean that matches the given id. If the bean is not of the required type then throw aBeanNotOfRequiredTypeException
.- Specified by:
getBean
in interfaceBeanRegistry
- Type Parameters:
T
- the generic type- Parameters:
id
- the id of the bean to retrieverequiredType
- type the bean must match; can be an interface or superclass- Returns:
- an instance of the bean
-
getBean
public <T> T getBean(java.lang.Class<T> requiredType, java.lang.String id)
Description copied from interface:BeanRegistry
Returns an instance of the bean that matches the given object type. If more than one matching bean is found, we pick a bean that matches the given id.- Specified by:
getBean
in interfaceBeanRegistry
- Type Parameters:
T
- the generic type- Parameters:
requiredType
- type the bean must match; can be an interface or superclassid
- the id of the bean to retrieve- Returns:
- an instance of the bean
-
getBeanForConfig
public <T> T getBeanForConfig(java.lang.Class<T> requiredType)
Description copied from interface:BeanRegistry
Returns the bean instance used for the annotated configuration that matches the specified object type. If the configurable bean is not of the required type then throw aRequiredTypeBeanNotFoundException
.- Specified by:
getBeanForConfig
in interfaceBeanRegistry
- Type Parameters:
T
- the generic type- Parameters:
requiredType
- type the bean must match; can be an interface or superclass- Returns:
- an instance of the bean
-
containsBean
public boolean containsBean(java.lang.String id)
Description copied from interface:BeanRegistry
Return whether a bean with the specified id is present.- Specified by:
containsBean
in interfaceBeanRegistry
- Parameters:
id
- the id of the bean to query- Returns:
- whether a bean with the specified id is present
-
containsBean
public boolean containsBean(java.lang.Class<?> requiredType)
Description copied from interface:BeanRegistry
Return whether a bean with the specified object type is present.- Specified by:
containsBean
in interfaceBeanRegistry
- Parameters:
requiredType
- the object type of the bean to query- Returns:
- whether a bean with the specified type is present
-
getBean
protected abstract <T> T getBean(BeanRule beanRule)
-
-