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 calling cleanup(boolean).
Since this is executed as post-mortem action for the corresponding LoggingFuture, it needs relevant fields as copy.
  • Field Details

  • Constructor Details

    • IgnoredResultLogger

      protected IgnoredResultLogger(LoggingFuture<?> obj)
      Creates new clean-up logic logging the result of the designated future as post-mortem action of the LoggingFuture in case its result has not been retrieved.
      Parameters:
      obj - The LoggingFuture of which to log the unnoticed result after it has been garbage-collected.
  • Method Details

    • cleanup

      public void cleanup(boolean explicit) throws RuntimeException
      Description copied from interface: CleanupTask
      Performs the actual clean-up. This method is only called by Cleanup and must NOT be called directly!
      Parameters:
      explicit - Whether the clean-up was triggered explicitly via Cleanup.clean(). Otherwise it was triggered implicitly as a post-mortem action by the object becoming phantom reachable.
      Throws:
      RuntimeException