public final class ReflectionBeanProvider extends Object implements BeanProvider
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Release any internal resource created to support provided beans.
|
static ReflectionBeanProvider |
create(ClassResolver classResolver) |
<T> BeanHolder<T> |
getBean(Class<T> typeReference)
Provide a bean referenced by its type.
|
<T> BeanHolder<T> |
getBean(Class<T> typeReference,
String implementationFullyQualifiedClassName)
Provide a bean referenced by its type and name.
|
<T> T |
getBeanNoClosingNecessary(Class<T> typeReference) |
<T> T |
getBeanNoClosingNecessary(Class<T> typeReference,
String implementationFullyQualifiedClassName) |
public static ReflectionBeanProvider create(ClassResolver classResolver)
public void close()
BeanProviderProvided 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 AutoCloseableclose in interface BeanProviderAutoCloseable.close()public <T> BeanHolder<T> getBean(Class<T> typeReference)
BeanProvidergetBean in interface BeanProviderT - 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.public <T> T getBeanNoClosingNecessary(Class<T> typeReference)
public <T> BeanHolder<T> getBean(Class<T> typeReference, String implementationFullyQualifiedClassName)
BeanProvidergetBean in interface BeanProviderT - The expected return type.typeReference - The type used as a reference to the bean to retrieve. Must be non-null.implementationFullyQualifiedClassName - The name used as a reference to the bean to retrieve. Must be non-null and non-empty.BeanHolder containing the resolved bean.Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.