Interface DisposableBeanDefinition<T>

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

@Internal public interface DisposableBeanDefinition<T> extends BeanDefinition<T>
A bean definition that provides disposing hooks normally in the form of PreDestroy annotated methods.
Since:
1.0
Author:
Graeme Rocher
See Also:
  • Method Details

    • dispose

      default T dispose(BeanContext context, T bean)
      Disposes of the bean definition by executing all PreDestroy hooks.
      Parameters:
      context - The bean context
      bean - The bean
      Returns:
      The bean instance
    • dispose

      T dispose(BeanResolutionContext resolutionContext, BeanContext context, T bean)
      Disposes of the bean definition by executing all PreDestroy hooks.
      Parameters:
      resolutionContext - The bean resolution context
      context - The bean context
      bean - The bean
      Returns:
      The bean instance