public interface BeanResolver extends AutoCloseable
This interface should only be called by the Hibernate Search engine itself;
if you are looking for retrieving beans from another module,
you should use BeanProvider
instead.
Modifier and Type | Method and Description |
---|---|
void |
close()
Release any internal resource created while resolving beans.
|
<T> BeanHolder<T> |
resolve(Class<T> typeReference)
Resolve a bean by its type.
|
<T> BeanHolder<T> |
resolve(Class<T> typeReference,
String nameReference)
Resolve a bean by its name.
|
void close()
Provided beans will not be usable after a call to this method.
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 AutoCloseable
AutoCloseable.close()
<T> BeanHolder<T> resolve(Class<T> typeReference)
T
- The expected return type.typeReference
- The type of the bean to resolve.BeanHolder
containing the resolved bean.SearchException
- if the bean cannot be resolved.<T> BeanHolder<T> resolve(Class<T> typeReference, String nameReference)
T
- The expected return type.typeReference
- The type of the bean to resolve.nameReference
- The name of the bean to resolve.BeanHolder
containing the resolved bean.SearchException
- if the bean cannot be resolved.Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.