Package de.aristaflow.adept2.util
Class CleanupTask.AtomicCloseTask
- java.lang.Object
-
- de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask<Exception>
-
- de.aristaflow.adept2.util.CleanupTask.CloseAndResetTask
-
- de.aristaflow.adept2.util.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 anAtomicReference
. This will atomically get the value and set it tonull
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.aristaflow.adept2.util.CleanupTask
CleanupTask.AbstractCleanupTask<EX extends Exception>, CleanupTask.AtomicCloseTask, CleanupTask.CloseAndResetTask, CleanupTask.MutableCloseTask
-
-
Field Summary
-
Fields inherited from class de.aristaflow.adept2.util.CleanupTask.CloseAndResetTask
reset, supplier
-
Fields inherited from class de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask
descriptor, logger
-
-
Constructor Summary
Constructors Constructor Description AtomicCloseTask(String descriptor, AtomicReference<?> aRef)
Creates a newCleanupTask.AtomicCloseTask
for the designatedAtomicReference
and the designated descriptor usingCleanup's default logger
.AtomicCloseTask(String descriptor, Logger logger, AtomicReference<?> aRef)
Creates a newCleanupTask.AtomicCloseTask
for the designatedAtomicReference
, the designated descriptor and the designated logger.
-
Method Summary
-
Methods inherited from class de.aristaflow.adept2.util.CleanupTask.CloseAndResetTask
cleanup
-
Methods inherited from class de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask
getDescriptor
-
-
-
-
Constructor Detail
-
AtomicCloseTask
public AtomicCloseTask(String descriptor, AtomicReference<?> aRef)
Creates a newCleanupTask.AtomicCloseTask
for the designatedAtomicReference
and the designated descriptor usingCleanup's default logger
.- Parameters:
descriptor
- A string that meaningfully describes this task when used for logging etc. ornull
.aRef
- The atomic reference which toAutoCloseable.close()
and set tonull
.
-
AtomicCloseTask
public AtomicCloseTask(String descriptor, Logger logger, AtomicReference<?> aRef)
Creates a newCleanupTask.AtomicCloseTask
for the designatedAtomicReference
, the designated descriptor and the designated logger.- Parameters:
descriptor
- A string that meaningfully describes this task when used for logging etc. ornull
.logger
- The logger for messages and/or problems, e. g. unexpected exceptions.aRef
- The atomic reference which toAutoCloseable.close()
and set tonull
.
-
-