Class LoggingFuture.IgnoredResultLogger
- java.lang.Object
-
- de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask<RuntimeException>
-
- de.aristaflow.adept2.util.threading.LoggingFuture.IgnoredResultLogger
-
- All Implemented Interfaces:
CleanupTask<RuntimeException>
- Enclosing class:
- LoggingFuture<V>
protected static final class LoggingFuture.IgnoredResultLogger extends CleanupTask.AbstractCleanupTask<RuntimeException>
This clean-up task logs the result of a future which no one retrieved. The result may be an exception. If this is not logged, some important results/exceptions may be lost unnoticed. This task will be ignored when the results of the future are retrieved (by explicitly callingcleanup(boolean)
.
Since this is executed as post-mortem action for the correspondingLoggingFuture
, it needs relevant fields as copy.
-
-
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 Modifier and Type Field Description protected RunnableFuture<?>
future
protected boolean
resultRelevant
-
Fields inherited from class de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask
descriptor, logger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
IgnoredResultLogger(LoggingFuture<?> obj)
Creates new clean-up logic logging the result of the designated future as post-mortem action of theLoggingFuture
in case its result has not been retrieved.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup(boolean explicit)
Performs the actual clean-up.-
Methods inherited from class de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask
getDescriptor
-
-
-
-
Field Detail
-
future
protected final RunnableFuture<?> future
-
resultRelevant
protected final boolean resultRelevant
-
-
Constructor Detail
-
IgnoredResultLogger
protected IgnoredResultLogger(LoggingFuture<?> obj)
Creates new clean-up logic logging the result of the designated future as post-mortem action of theLoggingFuture
in case its result has not been retrieved.- Parameters:
obj
- TheLoggingFuture
of which to log the unnoticed result after it has been garbage-collected.
-
-
Method Detail
-
cleanup
public void cleanup(boolean explicit) throws RuntimeException
Description copied from interface:CleanupTask
Performs the actual clean-up. This method is only called byCleanup
and 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:
RuntimeException
-
-