public class SimpleTerminableRegistry extends Object implements TerminableRegistry
EMPTY| Constructor and Description |
|---|
SimpleTerminableRegistry() |
| Modifier and Type | Method and Description |
|---|---|
<T extends Terminable> |
bind(T terminable)
Binds with the given terminable.
|
<T extends CompositeTerminable> |
bindComposite(T terminable)
Binds a composite terminable to this consumer
|
void |
cleanup()
Removes instances which have already been terminated via
Terminable.hasTerminated() |
boolean |
hasTerminated()
Used to help cleanup held terminable instances in registries
|
boolean |
terminate()
Terminate this instance
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatebindWith, close, ofbindRunnable@Nonnull public final <T extends Terminable> T bind(@Nonnull T terminable)
TerminableConsumerbind in interface TerminableConsumerT - the terminable typeterminable - the terminable to bind with@Nonnull public <T extends CompositeTerminable> T bindComposite(@Nonnull T terminable)
CompositeTerminableConsumerbindComposite in interface CompositeTerminableConsumerT - the terminable class typeterminable - the terminable to bindpublic final boolean terminate()
Terminableterminate in interface Terminablepublic final boolean hasTerminated()
TerminablehasTerminated in interface Terminablepublic final void cleanup()
TerminableRegistryTerminable.hasTerminated()cleanup in interface TerminableRegistryCopyright © 2017. All rights reserved.