Interface BeanResolutionCustomizer
public interface BeanResolutionCustomizer
Customizes selected bean resolution behavior for integrations.
- Since:
- 5.1.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanisCandidateBean(Argument<?> beanType, QualifiedBeanType<?> candidate) Returns whether the bean type is a candidate for the requested type.default Argument<?> resolveBeanLookupArgument(Argument<?> beanType) Resolve an additional argument that may be used to find bean candidates if the requested type does not resolve a bean.default <T> Optional<BeanDefinition<T>> resolveNonUniqueBean(Argument<T> beanType, @Nullable Qualifier<T> qualifier, Collection<BeanDefinition<T>> candidates) Resolve one bean from multiple qualified candidates before the default@Secondary, order, and default-implementation resolution rules are applied.default Optional<?> resolveNullBean(Argument<?> requestedBeanType, Argument<?> resolvedBeanType, BeanDefinition<?> beanDefinition) Resolve a replacement value for a bean that was found but producednull.default booleanshouldDestroyDependentBeanAfterResolution(BeanResolutionContext resolutionContext, BeanDefinition<?> beanDefinition) Returns whether a newly resolved dependent bean should be destroyed after the current bean resolution completes instead of being tracked as a dependent of the resolved bean.default booleanshouldInitializeBean(BeanResolutionContext resolutionContext, BeanDefinition<?> beanDefinition, Object bean) Returns whether a newly constructed bean instance should receive field/method injection and initialization callbacks.default booleanshouldPreserveLazyProxyTargetResolutionPath(BeanResolutionContext resolutionContext, BeanDefinition<?> proxyBeanDefinition) Returns whether a lazy proxy should preserve the current resolution path when storing the context that will later be used to resolve the proxy target.default booleanshouldResolveArrayAsBean(Argument<?> injectionPoint) Whether an object array injection point should first resolve an exact array bean.
-
Field Details
-
DEFAULT
The default customizer.
-
-
Method Details
-
shouldResolveArrayAsBean
Whether an object array injection point should first resolve an exact array bean.- Parameters:
injectionPoint- The array injection point- Returns:
- True to resolve an exact array bean
-
resolveBeanLookupArgument
-
isCandidateBean
Returns whether the bean type is a candidate for the requested type.- Parameters:
beanType- The requested bean typecandidate- The candidate bean type- Returns:
- True if the candidate matches
- Since:
- 5.1.0
-
resolveNonUniqueBean
default <T> Optional<BeanDefinition<T>> resolveNonUniqueBean(Argument<T> beanType, @Nullable Qualifier<T> qualifier, Collection<BeanDefinition<T>> candidates) Resolve one bean from multiple qualified candidates before the default@Secondary, order, and default-implementation resolution rules are applied.- Type Parameters:
T- The bean type- Parameters:
beanType- The requested bean typequalifier- The requested qualifiercandidates- The qualified candidates- Returns:
- The resolved bean, or empty to use default resolution
- Since:
- 5.1.0
-
resolveNullBean
default Optional<?> resolveNullBean(Argument<?> requestedBeanType, Argument<?> resolvedBeanType, BeanDefinition<?> beanDefinition) Resolve a replacement value for a bean that was found but producednull.- Parameters:
requestedBeanType- The originally requested bean typeresolvedBeanType- The resolved bean lookup typebeanDefinition- The bean definition that producednull- Returns:
- A replacement bean value, or empty to preserve the default behavior
- Since:
- 5.1.0
-
shouldDestroyDependentBeanAfterResolution
default boolean shouldDestroyDependentBeanAfterResolution(BeanResolutionContext resolutionContext, BeanDefinition<?> beanDefinition) Returns whether a newly resolved dependent bean should be destroyed after the current bean resolution completes instead of being tracked as a dependent of the resolved bean.- Parameters:
resolutionContext- The current resolution contextbeanDefinition- The dependent bean definition- Returns:
- True if the dependent bean should be destroyed after the current resolution completes
- Since:
- 5.1.0
-
shouldInitializeBean
default boolean shouldInitializeBean(BeanResolutionContext resolutionContext, BeanDefinition<?> beanDefinition, Object bean) Returns whether a newly constructed bean instance should receive field/method injection and initialization callbacks.- Parameters:
resolutionContext- The current resolution contextbeanDefinition- The bean definitionbean- The newly constructed bean instance- Returns:
- True if the bean instance should be injected and initialized
- Since:
- 5.1.0
-
shouldPreserveLazyProxyTargetResolutionPath
default boolean shouldPreserveLazyProxyTargetResolutionPath(BeanResolutionContext resolutionContext, BeanDefinition<?> proxyBeanDefinition) Returns whether a lazy proxy should preserve the current resolution path when storing the context that will later be used to resolve the proxy target.- Parameters:
resolutionContext- The current resolution contextproxyBeanDefinition- The proxy bean definition- Returns:
- True if the current resolution path should be preserved
- Since:
- 5.1.0
-