Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-8945

Call dispose() on Components before XWiki shutdown to cleanup resources

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5, 4.0
    • Fix Version/s: 5.0-milestone-2
    • Component/s: Containers
    • Labels:
      None
    • Environment:
      Java 6, Tomcat 7
    • keywords:
      shutdown clean up component
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      The org.xwiki.component.phase.Initializable interface works great to initialize Components.

      However, components aren't currently given a chance to clean up resources before XWiki shutdown.

      It would make sense to call the org.xwiki.component.phase.Disposable dispose() method on components before shutdown.
      This would give components a chance to "properly clean up its resources" per the Disposable javadoc.

      This could be used by a temporary file component to delete any outstanding files before XWiki shuts down,
      or clean up database connections etc.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tmortagne Thomas Mortagne
                Reporter:
                jamiem Jamie Maher
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: