Interface InterceptedBeanDefinition<T>

Type Parameters:
T - The bean definition type
All Superinterfaces:
AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, ArgumentCoercible<T>, BeanContextConditional, BeanDefinition<T>, BeanInfo<T>, BeanType<T>, InstantiatableBeanDefinition<T>, Named, Ordered, QualifiedBeanType<T>
All Known Subinterfaces:
ProxyInterceptedBeanDefinition<T>

@Internal public interface InterceptedBeanDefinition<T> extends InstantiatableBeanDefinition<T>
Since:
5.1.0
Author:
Denis Stepanov
  • Method Details

    • resolveInstantiationValues

      @Nullable Object[] resolveInstantiationValues(BeanResolutionContext resolutionContext, BeanContext context)
      Resolve the construction values.
      Parameters:
      resolutionContext - The resolution context
      context - The bean context
      Returns:
      the construction values
    • resolveInterceptors

      default @Nullable List<BeanRegistration<Interceptor<T,T>>> resolveInterceptors(BeanResolutionContext resolutionContext, AnnotationMetadataProvider constructor)
      Resolves the interceptors that construction, post-construct and pre-destroy interception of this bean all select from.

      The qualifier is built from the bean's own annotation metadata, so it covers every @InterceptorBinding the bean declares whatever kind each was declared for. That makes the result a superset of what any one phase needs; each interception point filters it again by its own binding and kind. Resolving once is what lets a non-singleton interceptor be shared by every phase of one bean.

      Override to supply the set another way. Returning null leaves each interception point to resolve its own, which is the behaviour of a bean that declares no interceptor binding at all.

      Parameters:
      resolutionContext - The resolution context
      constructor - The constructor, whose metadata is this bean's combined with the constructor's
      Returns:
      The interceptors, or null when the bean binds none
      Since:
      5.2.0
    • instantiate

      default T instantiate(BeanResolutionContext resolutionContext, BeanContext context)
      Description copied from interface: InstantiatableBeanDefinition
      Builds a bean instance.
      Specified by:
      instantiate in interface InstantiatableBeanDefinition<T>
      Parameters:
      resolutionContext - The bean resolution context
      context - The context
      Returns:
      The instance
    • doInstantiate

      T doInstantiate(BeanResolutionContext resolutionContext, BeanContext context, @Nullable Object[] parameterValues)
      The original instantiate(BeanResolutionContext, BeanContext) call that should be intercepted.
      Parameters:
      resolutionContext - The resolution context
      context - The bean context
      parameterValues - The construction values
      Returns:
      The intercepted result