Interface InitializingBeanDefinition<T>

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

public interface InitializingBeanDefinition<T> extends BeanDefinition<T>
A bean definition that is provides initialization hooks normally in the form of methods annotated with PostConstruct.
Since:
1.0
Author:
Graeme Rocher
See Also:
  • Method Details

    • initialize

      default T initialize(BeanContext context, T bean)
      Initializes the bean invoking all PostConstruct hooks.
      Parameters:
      context - The bean context
      bean - The bean
      Returns:
      The bean instance
    • initialize

      T initialize(BeanResolutionContext resolutionContext, BeanContext context, T bean)
      Initializes the bean invoking all PostConstruct hooks.
      Parameters:
      resolutionContext - The resolution context
      context - The bean context
      bean - The bean
      Returns:
      The bean instance
    • getPostConstructExecutableMethods

      default List<ExecutableMethod<T,?>> getPostConstructExecutableMethods()
      The PostConstruct callbacks of the bean as reflection-free executable methods, in the order initialize(BeanResolutionContext, BeanContext, Object) invokes them.

      Only available for a bean that intercepts its post-construct phase, that is one bound with @InterceptorBinding(kind = POST_CONSTRUCT); every other definition, including one compiled by an earlier version, returns an empty list. The callbacks are not part of BeanDefinition.getExecutableMethods().

      Returns:
      The post-construct callbacks, or an empty list
      Since:
      5.2.0