org.apache.struts2.dispatcher

## Interface InternalDestroyable

- All Known Subinterfaces:
    ContextAwareDestroyable
  All Known Implementing Classes:
    ComponentCacheDestroyable, CompoundRootAccessor, DefaultFileManager, FinalizableReferenceQueueDestroyable, FreemarkerCacheDestroyable, JBossFileManager, OgnlCacheDestroyable, ScopeInterceptorCacheDestroyable

      public interface InternalDestroyable

  Internal framework interface for components that hold static state (caches, daemon threads, etc.) requiring cleanup during application undeploy to prevent classloader leaks.

  Implementations are registered as named beans in `struts-beans.xml` (or plugin descriptors) with type `InternalDestroyable`. During `Dispatcher.cleanup()`, all registered implementations are discovered via `Container.getInstanceNames(InternalDestroyable.class)` and invoked automatically.

  The order in which implementations are invoked is not guaranteed. Implementations must not depend on other `InternalDestroyable` beans having been (or not yet been) destroyed. Ordering can be influenced via the `order` attribute in bean registration.

  This is not part of the public user API. For user/plugin lifecycle callbacks, use `DispatcherListener` instead.

  Since:
    6.9.0
  See Also:
    `Dispatcher.cleanup()`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Releases static state held by this component.

- - ### Method Detail

    - #### destroy

          void destroy()

      Releases static state held by this component. Called once during `Dispatcher.cleanup()`.

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.