public interface BeanProvider extends AutoCloseable
This interface should only be called by Hibernate Search itself;
if you are looking to retrieve beans,
you should use BeanResolver instead.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Release any internal resource created to support provided beans.
|
<T> BeanHolder<T> |
getBean(Class<T> typeReference)
Provide a bean referenced by its type.
|
<T> BeanHolder<T> |
getBean(Class<T> typeReference,
String nameReference)
Provide a bean referenced by its type and name.
|
void close()
Provided beans will not be usable after a call to this method.
This may not release all resources that were allocated for each BeanHolder;
BeanHolder.close() still needs to be called consistently for each created bean.
close in interface AutoCloseableAutoCloseable.close()<T> BeanHolder<T> getBean(Class<T> typeReference)
T - The expected return type.typeReference - The type used as a reference to the bean to retrieve. Must be non-null.BeanHolder containing the resolved bean.SearchException - if the reference is invalid (null) or the bean does not exist.<T> BeanHolder<T> getBean(Class<T> typeReference, String nameReference)
T - The expected return type.typeReference - The type used as a reference to the bean to retrieve. Must be non-null.nameReference - The name used as a reference to the bean to retrieve. Must be non-null and non-empty.BeanHolder containing the resolved bean.SearchException - if a reference is invalid (null or empty) or the bean does not exist.Copyright © 2006-2020 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.