Class LazyBean<T>
java.lang.Object
org.springframework.cloud.sleuth.internal.LazyBean<T>
Avoids calling the expensive
BeanFactory.getBean(Class) many
times or throwing an exception.
Note: This is an internal class to sleuth and must not be used by external code.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> LazyBean<T>create(org.springframework.context.ConfigurableApplicationContext springContext, Class<T> requiredType) get()Attempts to provision from the underlying bean factory, if not already provisioned.Attempts to provision from the underlying bean factory, if not already provisioned.
-
Method Details
-
create
-
get
Attempts to provision from the underlying bean factory, if not already provisioned.- Returns:
- the bean value or null if there was an exception getting it.
-
getOrError
Attempts to provision from the underlying bean factory, if not already provisioned.- Returns:
- the bean value. This variant does not catch exception.
-