DisposableRegistry
Interface describing a container for Disposables that provides functions for disposing all its registered items. An implementing class's Disposable declarations can be tagged with .alsoRegister() to conveniently register them as they are instantiated and assigned.
Calling dispose on the registry will call Disposable.dispose on all its registered members.
The existing implementation DisposableContainer can be extended or used as a delegate to implement this interface.
Note that since DisposableRegistry implements Disposable, registries can be stacked within each other - a registry might contain other registries, keeping track of nested assets.
Inheritors
Properties
Functions
Remove this Disposable from the DisposableRegistry if it is already registered.
Register this Disposable with the DisposableRegistry.
Removes disposable from this registry.
Removes all disposables from the registry without disposing them.
Calls dispose on each registered Disposable. Might throw an exception if the assets were already disposed. To prevent that and clear the registry, use deregisterAll.
Allows to gracefully dispose a resource implementing Disposable interface. Will silently ignore nulls and exceptions (except for JVM internal Errors, which should not be caught anyway).
Registers disposable with this registry.