Class CleanupTask.AtomicCloseTask

All Implemented Interfaces:
CleanupTask<Exception>
Enclosing interface:
CleanupTask<EX extends Exception>

public static final class CleanupTask.AtomicCloseTask extends CleanupTask.CloseAndResetTask
A simple cleanup task for cleaning up an AtomicReference. This will atomically get the value and set it to null.
  • Constructor Details

    • AtomicCloseTask

      public AtomicCloseTask(String descriptor, AtomicReference<?> aRef)
      Creates a new CleanupTask.AtomicCloseTask for the designated AtomicReference and the designated descriptor using Cleanup's default logger.
      Parameters:
      descriptor - A string that meaningfully describes this task when used for logging etc. or null.
      aRef - The atomic reference which to AutoCloseable.close() and set to null.
    • AtomicCloseTask

      public AtomicCloseTask(String descriptor, Logger logger, AtomicReference<?> aRef)
      Creates a new CleanupTask.AtomicCloseTask for the designated AtomicReference, the designated descriptor and the designated logger.
      Parameters:
      descriptor - A string that meaningfully describes this task when used for logging etc. or null.
      logger - The logger for messages and/or problems, e. g. unexpected exceptions.
      aRef - The atomic reference which to AutoCloseable.close() and set to null.