Class BeanResolverImpl
- java.lang.Object
-
- org.hibernate.search.engine.environment.bean.impl.BeanResolverImpl
-
- All Implemented Interfaces:
BeanResolver
public final class BeanResolverImpl extends Object implements BeanResolver
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> List<BeanReference<T>>allConfiguredForRole(Class<T> role)Return all the bean references configured for the given role.static BeanResolverImplcreate(ClassResolver classResolver, ServiceResolver serviceResolver, BeanProvider beanManagerBeanProvider, ConfigurationPropertySource rawConfigurationPropertySource)<T> Map<String,BeanReference<T>>namedConfiguredForRole(Class<T> role)Return named bean references configured for the given role.<T> BeanHolder<T>resolve(Class<T> typeReference, String nameReference, BeanRetrieval retrieval)Resolve a bean by its name.<T> BeanHolder<T>resolve(Class<T> typeReference, BeanRetrieval retrieval)Resolve a bean by its type.<T> BeanHolder<T>retrieveUsingConstructor(Class<T> typeReference)<T> Class<? extends T>toClass(Class<T> typeReference, String nameReference)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.search.engine.environment.bean.BeanResolver
resolve, resolve
-
-
-
-
Method Detail
-
create
public static BeanResolverImpl create(ClassResolver classResolver, ServiceResolver serviceResolver, BeanProvider beanManagerBeanProvider, ConfigurationPropertySource rawConfigurationPropertySource)
-
resolve
public <T> BeanHolder<T> resolve(Class<T> typeReference, BeanRetrieval retrieval)
Description copied from interface:BeanResolverResolve a bean by its type.- Specified by:
resolvein interfaceBeanResolver- Type Parameters:
T- The expected return type.- Parameters:
typeReference- The type used as a reference to the bean to resolve. Must be non-null.retrieval- How to retrieve the bean. SeeBeanRetrieval.- Returns:
- A
BeanHoldercontaining the resolved bean.
-
resolve
public <T> BeanHolder<T> resolve(Class<T> typeReference, String nameReference, BeanRetrieval retrieval)
Description copied from interface:BeanResolverResolve a bean by its name.- Specified by:
resolvein interfaceBeanResolver- Type Parameters:
T- The expected return type.- Parameters:
typeReference- The type used as a reference to the bean to resolve. Must be non-null.nameReference- The name used as a reference to the bean to resolve. Must be non-null and non-empty.retrieval- How to retrieve the bean. SeeBeanRetrieval.- Returns:
- A
BeanHoldercontaining the resolved bean.
-
allConfiguredForRole
public <T> List<BeanReference<T>> allConfiguredForRole(Class<T> role)
Description copied from interface:BeanResolverReturn all the bean references configured for the given role.WARNING: this does not just return references to all the beans that implement
role. Only beans registered duringbean configurationare taken into account.- Specified by:
allConfiguredForRolein interfaceBeanResolver- Type Parameters:
T- The expected bean type.- Parameters:
role- The role that must have been assigned to the retrieved beans. Must be non-null and non-empty.- Returns:
- A
Listof bean references, possibly empty.
-
namedConfiguredForRole
public <T> Map<String,BeanReference<T>> namedConfiguredForRole(Class<T> role)
Description copied from interface:BeanResolverReturn named bean references configured for the given role.WARNING: this does not just return references to all the beans that implement
role. Only beans registered duringbean configurationare taken into account.- Specified by:
namedConfiguredForRolein interfaceBeanResolver- Type Parameters:
T- The expected bean type.- Parameters:
role- The role that must have been assigned to the retrieved beans. Must be non-null and non-empty.- Returns:
- A
Mapfrom name to bean reference, possibly empty.
-
retrieveUsingConstructor
public <T> BeanHolder<T> retrieveUsingConstructor(Class<T> typeReference)
-
-