@FunctionalInterface public interface Terminable extends AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
static Terminable |
EMPTY |
| Modifier and Type | Method and Description |
|---|---|
default void |
bindWith(TerminableConsumer consumer)
Registers this terminable with a terminable consumer (usually the plugin instance)
|
default void |
close() |
default boolean |
hasTerminated()
Used to help cleanup held terminable instances in registries
|
static Terminable |
of(Runnable r) |
boolean |
terminate()
Terminate this instance
|
static final Terminable EMPTY
@Nonnull static Terminable of(@Nonnull Runnable r)
boolean terminate()
default void bindWith(@Nonnull TerminableConsumer consumer)
consumer - the terminable consumerdefault boolean hasTerminated()
default void close()
close in interface AutoCloseableCopyright © 2017. All rights reserved.