Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-57

Add a new Disposable interface to allow the component manager to properly unregister singleton components.

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.3-milestone-2
    • 3.3-milestone-1
    • Component
    • None

    Description

      Provide a new Disposable interface, with a single method dispose(), that could be implemented by a component and that is called when a (singleton) component is released from the available instances. This could only happen in two situation:

      • a component descriptor with the same role and rolehint as the component is registered and replace the existing one
      • the role and rolehint of the component is unregistered

      This allow the released component to properly clean up its ressources usage. There is obviously no assurance that other components do not hold a reference on the destroyed one. It is advised that any component which depends on a component exposing the Disposable interface to not hold a reference on it longer than needed, and that any component that maybe disposed to implement this interface, at least as a marker interface.

      This improvement is needed to be able to reload "on the fly" wiki components, "java" wiki macros.

      Attachments

        Activity

          People

            softec Denis Gervalle
            softec Denis Gervalle
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: