Interface BeanResolutionCustomizer


public interface BeanResolutionCustomizer
Customizes selected bean resolution behavior for integrations.
Since:
5.1.0
  • Field Details

  • Method Details

    • shouldResolveArrayAsBean

      default boolean shouldResolveArrayAsBean(Argument<?> injectionPoint)
      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

      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.
      Parameters:
      beanType - The requested bean type
      Returns:
      The additional bean type to use for lookup
      Since:
      5.1.0
    • isCandidateBean

      default boolean isCandidateBean(Argument<?> beanType, QualifiedBeanType<?> candidate)
      Returns whether the bean type is a candidate for the requested type.
      Parameters:
      beanType - The requested bean type
      candidate - 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 type
      qualifier - The requested qualifier
      candidates - 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 produced null.
      Parameters:
      requestedBeanType - The originally requested bean type
      resolvedBeanType - The resolved bean lookup type
      beanDefinition - The bean definition that produced null
      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 context
      beanDefinition - 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 context
      beanDefinition - The bean definition
      bean - 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 context
      proxyBeanDefinition - The proxy bean definition
      Returns:
      True if the current resolution path should be preserved
      Since:
      5.1.0