Package org.alban098.common
Class MemoryManager
java.lang.Object
org.alban098.common.MemoryManager
This static class is tasked with keeping track and cleaning up every Cleanable object
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidfinish()Cleans up all Objectsstatic voidCleans up an Objects and stop keeping track of it(package private) static voidAdds a new Cleanable to the Manager, only called byCleanable.initialize()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGERJust a Logger to log events -
OBJECTS
A Map of all Cleanable objects of the application, sorted by type
-
-
Constructor Details
-
MemoryManager
public MemoryManager()
-
-
Method Details
-
register
Adds a new Cleanable to the Manager, only called byCleanable.initialize()- Parameters:
cleanable- the cleanable to add
-
finish
public static void finish()Cleans up all Objects -
free
Cleans up an Objects and stop keeping track of it- Parameters:
cleanable- the object to free
-