Interface ContextAwareDestroyable

All Superinterfaces:
InternalDestroyable
All Known Implementing Classes:
FreemarkerCacheDestroyable

public interface ContextAwareDestroyable extends InternalDestroyable
Extension of InternalDestroyable for components that require ServletContext during cleanup (e.g. clearing servlet-scoped caches). <p>During Dispatcher.cleanup(), the discovery loop checks each InternalDestroyable bean: if it implements this subinterface, destroy(ServletContext) is called instead of destroy().</p>
Since:
7.2.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Default no-op — Dispatcher calls destroy(ServletContext) instead when it recognises this type.
    void
    destroy(jakarta.servlet.ServletContext servletContext)
    Releases state that requires access to the ServletContext.
  • Method Details

    • destroy

      void destroy(jakarta.servlet.ServletContext servletContext)
      Releases state that requires access to the ServletContext.
      Parameters:
      servletContext - the current servlet context, may be null if the Dispatcher was created without one
    • destroy

      default void destroy()
      Default no-op — Dispatcher calls destroy(ServletContext) instead when it recognises this type.
      Specified by:
      destroy in interface InternalDestroyable