Class ContextualBeanRegistry
- java.lang.Object
-
- com.aspectran.core.component.AbstractComponent
-
- com.aspectran.core.component.bean.ContextualBeanRegistry
-
- All Implemented Interfaces:
BeanRegistry,Component
public class ContextualBeanRegistry extends AbstractComponent
The Class ContextualBeanRegistry.Created: 2009. 03. 09 PM 23:48:09
-
-
Constructor Summary
Constructors Constructor Description ContextualBeanRegistry(ActivityContext context, BeanRuleRegistry beanRuleRegistry, BeanProxifierType beanProxifierType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsBean(java.lang.Class<?> type)Return whether a bean with the specified object type is present.booleancontainsBean(java.lang.Class<?> type, java.lang.String id)booleancontainsBean(java.lang.String id)Return whether a bean with the specified id is present.protected java.lang.ObjectcreateBean(BeanRule beanRule)protected java.lang.ObjectcreateBean(BeanRule beanRule, Scope scope)protected java.lang.ObjectcreateBean(BeanRule beanRule, Scope scope, Activity activity)voiddestroySingleton(java.lang.Object bean)protected voiddoDestroy()protected voiddoInitialize()java.util.Collection<java.lang.Class<?>>findConfigBeanClassesWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)protected ActivityContextgetActivityContext()protected <V> VgetBean(BeanRule beanRule)<V> VgetBean(java.lang.Class<V> type)Returns the bean instance that uniquely matches the given object type.<V> VgetBean(java.lang.Class<V> type, java.lang.String id)Returns an instance of the bean that matches the given object type.<V> VgetBean(java.lang.String id)Returns an instance of the bean that matches the given id.protected BeanRuleRegistrygetBeanRuleRegistry()<V> V[]getBeansOfType(java.lang.Class<V> type)protected java.lang.ObjectgetFactoryProducedObject(BeanRule beanRule, java.lang.Object bean)<V> VgetPrototypeScopeBean(BeanRule beanRule)booleanhasSingleton(java.lang.Class<?> type)booleanhasSingleton(java.lang.Class<?> type, java.lang.String id)booleanhasSingleton(java.lang.Object bean)-
Methods inherited from class com.aspectran.core.component.AbstractComponent
destroy, getComponentName, initialize, isAvailable, isDestroyed, isDestroying, isInitialized
-
-
-
-
Constructor Detail
-
ContextualBeanRegistry
public ContextualBeanRegistry(ActivityContext context, BeanRuleRegistry beanRuleRegistry, BeanProxifierType beanProxifierType)
-
-
Method Detail
-
getBean
public <V> V getBean(@NonNull java.lang.String id)
Description copied from interface:BeanRegistryReturns an instance of the bean that matches the given id.- Type Parameters:
V- the result type of the bean- Parameters:
id- the id of the bean to retrieve- Returns:
- an instance of the bean
-
getBean
public <V> V getBean(@NonNull java.lang.Class<V> type)
Description copied from interface:BeanRegistryReturns the bean instance that uniquely matches the given object type.- Type Parameters:
V- the result type of the bean- Parameters:
type- the type the bean must match; can be an interface or superclass- Returns:
- an instance of the bean
-
getBean
public <V> V getBean(@NonNull java.lang.Class<V> type, @Nullable java.lang.String id)
Description copied from interface:BeanRegistryReturns 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.- Type Parameters:
V- the result type of the bean- Parameters:
type- type the bean must match; can be an interface or superclassid- the id of the bean to retrieve- Returns:
- an instance of the bean
-
getBeansOfType
public <V> V[] getBeansOfType(@NonNull java.lang.Class<V> type)
-
containsBean
public boolean containsBean(@NonNull java.lang.String id)
Description copied from interface:BeanRegistryReturn whether a bean with the specified id is present.- Parameters:
id- the id of the bean to query- Returns:
- whether a bean with the specified id is present
-
containsBean
public boolean containsBean(@NonNull java.lang.Class<?> type)
Description copied from interface:BeanRegistryReturn whether a bean with the specified object type is present.- Parameters:
type- the object type of the bean to query- Returns:
- whether a bean with the specified type is present
-
containsBean
public boolean containsBean(@NonNull java.lang.Class<?> type, @Nullable java.lang.String id)
-
findConfigBeanClassesWithAnnotation
public java.util.Collection<java.lang.Class<?>> findConfigBeanClassesWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
-
getBeanRuleRegistry
protected BeanRuleRegistry getBeanRuleRegistry()
-
getBean
protected <V> V getBean(BeanRule beanRule)
-
getPrototypeScopeBean
public <V> V getPrototypeScopeBean(BeanRule beanRule)
- Specified by:
getPrototypeScopeBeanin interfaceBeanRegistry
-
hasSingleton
public boolean hasSingleton(java.lang.Object bean)
- Specified by:
hasSingletonin interfaceBeanRegistry
-
hasSingleton
public boolean hasSingleton(@NonNull java.lang.Class<?> type)
- Specified by:
hasSingletonin interfaceBeanRegistry
-
hasSingleton
public boolean hasSingleton(@NonNull java.lang.Class<?> type, @Nullable java.lang.String id)
- Specified by:
hasSingletonin interfaceBeanRegistry
-
destroySingleton
public void destroySingleton(java.lang.Object bean) throws java.lang.Exception- Specified by:
destroySingletonin interfaceBeanRegistry- Throws:
java.lang.Exception
-
doInitialize
protected void doInitialize() throws java.lang.Exception- Specified by:
doInitializein classAbstractComponent- Throws:
java.lang.Exception
-
doDestroy
protected void doDestroy() throws java.lang.Exception- Specified by:
doDestroyin classAbstractComponent- Throws:
java.lang.Exception
-
getActivityContext
protected ActivityContext getActivityContext()
-
createBean
protected java.lang.Object createBean(BeanRule beanRule)
-
getFactoryProducedObject
protected java.lang.Object getFactoryProducedObject(BeanRule beanRule, java.lang.Object bean)
-
-