public abstract class AbstractDisposable extends Object implements Disposable
Disposable
classes.
When an instance of this class is created, it is registered as in use, and it is removed in the dispose method.
Constructor and Description |
---|
AbstractDisposable() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes the current object, to allow it to close and dispose any used
resources.
|
protected void |
dispose(Disposable disposable)
Utility method to dispose a
Disposable , checking if it is null. |
protected abstract void |
doDispose()
Internal implementation for the
dispose() method, to be
implemented by child classes. |
public final void dispose()
Disposable
NOTE:After calling this method, the object may not be usable anymore.
dispose
in interface Disposable
protected void dispose(Disposable disposable)
Disposable
, checking if it is null.disposable
- to disposeprotected abstract void doDispose() throws BaseException
dispose()
method, to be
implemented by child classes.BaseException
dispose()