public class SynchronousDisposingExecutor extends Object implements RunnableExecutor
Constructor and Description |
---|
SynchronousDisposingExecutor() |
Modifier and Type | Method and Description |
---|---|
void |
add(Disposable runOnStop)
Add a
Disposable to be disposed when this component is disposed |
void |
dispose()
Dispose this instance.
|
void |
execute(Runnable command) |
boolean |
remove(Disposable disposable)
Remove a
Disposable from being disposed when this component is disposed |
void |
run() |
int |
size()
Return the number of
Disposable instances registered with this instance. |
public void add(Disposable runOnStop)
DisposingExecutor
Disposable
to be disposed when this component is disposedadd
in interface DisposingExecutor
runOnStop
- Disposable instance. Should not be null.public boolean remove(Disposable disposable)
DisposingExecutor
Disposable
from being disposed when this component is disposedremove
in interface DisposingExecutor
disposable
- Disposable instance. Should not be nullpublic int size()
DisposingExecutor
Disposable
instances registered with this instance.
This method is typically used for testing and debugging purposes.size
in interface DisposingExecutor
Disposable
instances registered.public void dispose()
Disposable
dispose
in interface Disposable
Copyright © 2017. All Rights Reserved.