Package com.complexible.common.base
Class Disposer
java.lang.Object
com.complexible.common.base.Disposer
- All Implemented Interfaces:
Disposable
Utility for tracking and mass Disposable.dispose() of Disposable resources.
- Since:
- 5.0
- Version:
- 5.0
- Author:
- Michael Grove
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Dispose the resources held by this object.<T extends Disposable>
Tregister(T theToDispose) Add a newDisposablefor tracking to this `Disposer`
-
Constructor Details
-
Disposer
public Disposer()
-
-
Method Details
-
register
Add a newDisposablefor tracking to this `Disposer`- Parameters:
theToDispose- the object to eventually dispose of- Returns:
- this disposer
-
dispose
public void dispose()Dispose the resources held by this object. Use this function with care since disposed objects cannot be reused again. If the resources (files, pages, etc.) held by this object will be needed again callingCloseable.close()or some other method will be more appropriate.- Specified by:
disposein interfaceDisposable
-