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.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 byCleanupand registered as post-mortem action for specific objects. UnlikeCleaner, this allows for checked exceptions which are sensible for normal cleanup actions, e. g.Closeable.close().
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static 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 classCleanupTask.AtomicCloseTaskA simple cleanup task for cleaning up anAtomicReference.static classCleanupTask.CloseAndResetTaskAn abstract cleanup task for closing a suppliedAutoCloseableand resetting it via aRunnable.static classCleanupTask.MutableCloseTaskA simple cleanup task for cleaning up aMutable.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcleanup(boolean explicit)Performs the actual clean-up.default StringgetDescriptor()Gets a string that meaningfully describes or identifies this task when used in log message etc.
-
-
-
Method Detail
-
getDescriptor
default String 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
void cleanup(boolean explicit) throws EX extends ExceptionPerforms 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 exceptionEX extends Exception
-
-