Interface BeanRegistry
-
- All Known Implementing Classes:
ContextualBeanRegistry
public interface BeanRegistryThe Interface BeanRegistry.- Since:
- 2012. 11. 9.
-
-
Method Summary
All Methods Instance Methods Abstract 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.voiddestroySingleton(java.lang.Object bean)java.util.Collection<java.lang.Class<?>>findConfigBeanClassesWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)<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.<V> V[]getBeansOfType(java.lang.Class<V> type)<V> VgetPrototypeScopeBean(BeanRule beanRule)booleanhasSingleton(java.lang.Class<?> type)booleanhasSingleton(java.lang.Class<?> type, java.lang.String id)booleanhasSingleton(java.lang.Object bean)
-
-
-
Method Detail
-
getBean
<V> V getBean(java.lang.String id)
Returns 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
<V> V getBean(java.lang.Class<V> type)
Returns 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
- Since:
- 1.3.1
-
getBean
<V> V getBean(java.lang.Class<V> type, java.lang.String id)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.- 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
- Since:
- 2.0.0
-
getBeansOfType
<V> V[] getBeansOfType(java.lang.Class<V> type)
-
getPrototypeScopeBean
<V> V getPrototypeScopeBean(BeanRule beanRule)
-
containsBean
boolean containsBean(java.lang.String id)
Return 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
boolean containsBean(java.lang.Class<?> type)
Return 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
boolean containsBean(java.lang.Class<?> type, java.lang.String id)
-
findConfigBeanClassesWithAnnotation
java.util.Collection<java.lang.Class<?>> findConfigBeanClassesWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
-
hasSingleton
boolean hasSingleton(java.lang.Object bean)
-
hasSingleton
boolean hasSingleton(@NonNull java.lang.Class<?> type)
-
hasSingleton
boolean hasSingleton(java.lang.Class<?> type, java.lang.String id)
-
destroySingleton
void destroySingleton(java.lang.Object bean) throws java.lang.Exception- Throws:
java.lang.Exception
-
-