Package com.helger.base.cleanup
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
-
Field Summary
Fields inherited from interface com.helger.base.cleanup.ICleanUpRegistry
PRIORITY_DEFAULT, PRIORITY_MAX, PRIORITY_MIN -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull CleanUpRegistrystatic booleanvoidExecute all registered cleanup actions in priority order.voidregisterCleanup(int nPriority, @NonNull Runnable aRunnable) Register a cleanup action.voidReinitialize the clean up registry by re-reading all SPI implementations.
-
Method Details
-
isInstantiated
public static boolean isInstantiated()- Returns:
trueif the singleton instance has been created,falseotherwise.
-
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
Register a cleanup action.- Specified by:
registerCleanupin interfaceICleanUpRegistry- Parameters:
nPriority- Priority - the higher the earlier it is calledaRunnable- The runnable to be executed. May not benull.
-
performCleanUp
public void performCleanUp()Execute all registered cleanup actions in priority order.
-