Class BeanResolverImpl
java.lang.Object
org.hibernate.search.engine.environment.bean.impl.BeanResolverImpl
- All Implemented Interfaces:
BeanResolver
-
Method Summary
Modifier and TypeMethodDescription<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>Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.search.engine.environment.bean.BeanResolver
resolve, resolve
-
Method Details
-
create
public static BeanResolverImpl create(ClassResolver classResolver, ServiceResolver serviceResolver, BeanProvider beanManagerBeanProvider, ConfigurationPropertySource rawConfigurationPropertySource) -
resolve
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
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
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.
-
toClass
-
retrieveUsingConstructor
-