Interface CleanupTask<EX extends Exception>

    • Method Detail

      • getDescriptor

        default String getDescriptor()
        Gets a string that meaningfully describes or identifies this task when used in log message etc. When null is returned a descriptor will be automatically determined using #toString().
        Returns:
        A string that meaningfully describes this task when used for logging etc. or null.
      • cleanup

        void cleanup​(boolean explicit)
              throws EX extends Exception
        Performs the actual clean-up. This method is only called by Cleanup and must NOT be called directly!
        Parameters:
        explicit - Whether the clean-up was triggered explicitly via Cleanup.clean(). Otherwise it was triggered implicitly as a post-mortem action by the object becoming phantom reachable.
        Throws:
        EX - the exception
        EX extends Exception