Class CleanerProvider

java.lang.Object
org.frankframework.util.CleanerProvider

public class CleanerProvider extends Object
Starts the singleton Cleaner thread of F!F, to clean a resource when it becomes phantom reachable.
  • Method Details

    • logLeakStatistics

      public static void logLeakStatistics()
    • register

      public static int register(Object obj, Runnable cleaningAction)
      Method to register a cleaning-action for a method.
      Parameters:
      obj - Object for which the cleaning-action should be registered
      cleaningAction - Cleaning Action to register
      Returns:
      ID of the cleaning action, which can be used to execute it.
    • clean

      public static void clean(Runnable cleaningAction)
      Execute the cleaning action, if it needs to be manually invoked before the object is out of scope, for instance from a close-method. This de-registers the cleaning action and marks it so that it is not counted as leaked.
      Parameters:
      cleaningAction - Cleaning Action to execute.
    • clean

      public static void clean(int actionId)
      Execute cleaning action by ID.
      Parameters:
      actionId - ID of the cleaning action.