Class CleanUpRegistry

java.lang.Object
com.helger.base.cleanup.CleanUpRegistry
All Implemented Interfaces:
ICleanUpRegistry

@ThreadSafe @Singleton public final class CleanUpRegistry extends Object implements ICleanUpRegistry
This class contains all the cleanup actions which resets library caches etc. to their original state.
Author:
Philip Helger
  • Method Details

    • isInstantiated

      public static boolean isInstantiated()
      Returns:
      true if the singleton instance has been created, false otherwise.
    • getInstance

      public static @NonNull CleanUpRegistry getInstance()
      Returns:
      The singleton instance of this class. Never null.
    • reinitialize

      public void reinitialize()
      Reinitialize the clean up registry by re-reading all SPI implementations.
    • registerCleanup

      public void registerCleanup(int nPriority, @NonNull Runnable aRunnable)
      Register a cleanup action.
      Specified by:
      registerCleanup in interface ICleanUpRegistry
      Parameters:
      nPriority - Priority - the higher the earlier it is called
      aRunnable - The runnable to be executed. May not be null.
    • performCleanUp

      public void performCleanUp()
      Execute all registered cleanup actions in priority order.