Interface BeanRegistry
-
- All Known Implementing Classes:
AbstractActivity,AbstractBeanRegistry,AbstractTranslet,AdviceActivity,ContextBeanRegistry,CoreActivity,CoreTranslet,DefaultActivity,InstantActivity,JobActivity,SessionScopeActivity
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<?> requiredType)Return whether a bean with the specified object type is present.booleancontainsBean(java.lang.String id)Return whether a bean with the specified id is present.<T> TgetBean(java.lang.Class<T> requiredType)Return an instance of the bean that matches the given object type.<T> TgetBean(java.lang.Class<T> requiredType, java.lang.String id)Return an instance of the bean that matches the given object type.<T> TgetBean(java.lang.String id)Return an instance of the bean that matches the given id.<T> TgetBean(java.lang.String id, java.lang.Class<T> requiredType)Return an instance of the bean that matches the given id.<T> TgetConfigBean(java.lang.Class<T> requiredType)Return the bean instance that matches the specified object type.
-
-
-
Method Detail
-
getBean
<T> T getBean(java.lang.String id)
Return an instance of the bean that matches the given id.- Type Parameters:
T- the generic type- Parameters:
id- the id of the bean to retrieve- Returns:
- an instance of the bean
-
getBean
<T> T getBean(java.lang.Class<T> requiredType)
Return an instance of the bean that matches the given object type.- Type Parameters:
T- the generic type- Parameters:
requiredType- the type the bean must match; can be an interface or superclass.nullis disallowed.- Returns:
- an instance of the bean
- Since:
- 1.3.1
-
getBean
<T> T getBean(java.lang.String id, java.lang.Class<T> requiredType)Return an instance of the bean that matches the given id. If the bean is not of the required type then throw a BeanNotOfRequiredTypeException.- 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.nullis disallowed.- Returns:
- an instance of the bean
- Since:
- 1.3.1
-
getBean
<T> T getBean(java.lang.Class<T> requiredType, java.lang.String id)Return an instance of the bean that matches the given object type. If the bean is not exists ,retrieve the bean with the specified id.- Type Parameters:
T- the generic type- Parameters:
requiredType- type the bean must match; can be an interface or superclass.nullis allowed.id- the id of the bean to retrieve; if requiredType isnull.- Returns:
- an instance of the bean
- Since:
- 2.0.0
-
getConfigBean
<T> T getConfigBean(java.lang.Class<T> requiredType)
Return the bean instance that matches the specified object type. If the bean is not of the required type then throw aBeanNotOfRequiredTypeException.- Type Parameters:
T- the generic type- Parameters:
requiredType- type the bean must match; can be an interface or superclass.nullis disallowed.- Returns:
- an instance of the bean
- Since:
- 2.0.0
-
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<?> requiredType)
Return whether a bean with the specified object type is present.- Parameters:
requiredType- the object type of the bean to query- Returns:
- whether a bean with the specified type is present
-
-