Package de.aristaflow.adept2.util
Interface CleanupTask<EX extends Exception>
- Type Parameters:
EX- The type of the checked exception thrown by the cleanup task.
- All Known Implementing Classes:
AbstractHTMLContext.HtmlContextCleanupTask,BufferedRereadableContent.BrcCleanup,CachingIncWorklistUpdate.CachingIncWorklistUpdateCloseTask,CachingRemoteIterator.CachingRemoteIteratorCloseTask,Cleanup.CollCloseTask,Cleanup.CollectionCloseTask,CleanupTask.AbstractCleanupTask,CleanupTask.AtomicCloseTask,CleanupTask.CloseAndResetTask,CleanupTask.MutableCloseTask,LoggingFuture.IgnoredResultLogger,MemoryResultSetImpl.MrsiCleanup,RereadableContent.RrcCleanup,RereadableContentBuilder.RcbCleanup,ResultSetRemoteIterator.ResultSetRemoteIteratorCloseTask,SwtHtmlContext.BrowserCloseTask,SwtUrlContext.BrowserCloseTask,TransformingRemoteIterator.TransformingRemoteIteratorCloseTask
public interface CleanupTask<EX extends Exception>
This interface provides the means for clean-up logic as normal or as post-mortem action. It is
being used by
Cleanup and registered as post-mortem action for specific objects. Unlike
Cleaner, this allows for checked exceptions which are sensible for normal cleanup
actions, e. g. Closeable.close().-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classCleanupTask.AbstractCleanupTask<EX extends Exception>Convenient base class forCleanupTaskwith the option to provide a custom descriptor for the clean-up task and/or a logger.static final classA simple cleanup task for cleaning up anAtomicReference.static classAn abstract cleanup task for closing a suppliedAutoCloseableand resetting it via aRunnable.static final classA simple cleanup task for cleaning up aMutable. -
Method Summary
-
Method Details
-
getDescriptor
Gets a string that meaningfully describes or identifies this task when used in log message etc. Whennullis 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
Performs the actual clean-up. This method is only called byCleanupand must NOT be called directly!- Parameters:
explicit- Whether the clean-up was triggered explicitly viaCleanup.clean(). Otherwise it was triggered implicitly as a post-mortem action by the object becoming phantom reachable.- Throws:
EX- the exception
-