Class CleanupTask.CloseAndResetTask

    • Field Detail

      • supplier

        protected final Supplier<?> supplier
        The supplier providing an AutoCloseable which to AutoCloseable.close() or null or a different interface.
      • reset

        protected final Runnable reset
        A runnable for resetting the supplied value or null to skip resetting.
    • Method Detail

      • cleanup

        public void cleanup​(boolean explicit)
                     throws Exception
        Description copied from interface: CleanupTask
        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:
        Exception