Class Finalizer

java.lang.Object
org.armedbear.lisp.util.Finalizer

public class Finalizer extends Object
Framework to monitor arbitrary objects to see if they have been garbage collected, running one or more runnables when they have.
  • Constructor Details

    • Finalizer

      public Finalizer()
  • Method Details

    • addFinalizer

      public static void addFinalizer(Object o, Runnable r)
      Schedules a Runnable to be run after garbage collection of the object. Note that the Runnable can't contain references to the object to be collected: it will disable garbage collection of the object.
      Parameters:
      o - The object to monitor for garbage collection
      r - The routine to be executed after GC-ing the object
    • clearFinalizers

      public static void clearFinalizers(Object o)
      Cancels any references scheduled to be run after garbage collection of the argument 'o'.
      Parameters:
      o - Object to cancel references for