Class SelfCleaningRunnable

java.lang.Object
org.apache.drill.common.SelfCleaningRunnable
All Implemented Interfaces:
Runnable

public abstract class SelfCleaningRunnable extends Object implements Runnable
A wrapper for Runnables that provides a hook to do cleanup.
  • Constructor Details

    • SelfCleaningRunnable

      public SelfCleaningRunnable(Runnable runnable)
      Constructor.
      Parameters:
      runnable - the Runnable to wrap
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • cleanup

      protected abstract void cleanup()
      Cleanup.

      Derived classes should put any necessary cleanup in here. This is guaranteed to be called, even if the wrapped Runnable throws an exception.