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> T |
resolve(Class<?> typeReference,
Class<T> expectedClass)
Resolve a bean by its type.
|
<T> T |
resolve(String nameReference,
Class<?> typeReference,
Class<T> expectedClass)
Resolve a bean by its name and type.
|
<T> T |
resolve(String nameReference,
Class<T> expectedClass)
Resolve a bean by its name.
|
void close()
Provided beans will not be usable after a call to this method.
close
in interface AutoCloseable
AutoCloseable.close()
<T> T resolve(Class<?> typeReference, Class<T> expectedClass)
T
- The expected return type.typeReference
- The type of the bean to resolve.
Depending on the implementation, this could be a superclass or superinterface of the resolved bean.expectedClass
- The expected class. The returned bean must implement this class.SearchException
- if the bean cannot be resolved.<T> T resolve(String nameReference, Class<T> expectedClass)
T
- The expected return type.nameReference
- The name of the bean to resolve.expectedClass
- The expected class. The returned bean must implement this class.SearchException
- if the bean cannot be resolved.<T> T resolve(String nameReference, Class<?> typeReference, Class<T> expectedClass)
T
- The expected return type.nameReference
- The name of the bean to resolve.typeReference
- The type of the bean to resolve.
Depending on the implementation, this could be a superclass or superinterface of the resolved bean.expectedClass
- The expected class. The returned bean must implement this class.SearchException
- if the bean cannot be resolved.Copyright © 2006-2018 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.