public class DefaultDisposableManager extends Object implements DisposableManager
DisposableManager
.Constructor and Description |
---|
DefaultDisposableManager()
Creates a new
DefaultDisposableManager . |
Modifier and Type | Method and Description |
---|---|
boolean |
bind(Disposable disposable)
Registers a disposable as being in use.
|
int |
getBoundDisposableCount()
Returns the number of Disposable objects pending to be released.
|
Set |
getBoundDisposables()
Returns a
Set of Disposable objects currently bound. |
boolean |
release(Disposable disposable)
Marks a disposable as not being used anymore.
|
void |
releaseAll()
Releases all bound
Disposable s. |
public DefaultDisposableManager()
DefaultDisposableManager
.public boolean bind(Disposable disposable)
DisposableManager
bind
in interface DisposableManager
disposable
- to bindpublic boolean release(Disposable disposable)
DisposableManager
release
in interface DisposableManager
disposable
- to releasepublic void releaseAll() throws BaseException
DisposableManager
Disposable
s.releaseAll
in interface DisposableManager
BaseException
- if there is an error disposing any of the bound disposablespublic int getBoundDisposableCount()
DisposableManager
getBoundDisposableCount
in interface DisposableManager
public Set getBoundDisposables()
DisposableManager
Set
of Disposable
objects currently bound.getBoundDisposables
in interface DisposableManager