Class AbstractCompositeTerminable
java.lang.Object
dev.demeng.pluginbase.terminable.composite.AbstractCompositeTerminable
- All Implemented Interfaces:
CompositeTerminable,Terminable,TerminableConsumer,AutoCloseable
-
Field Summary
Fields inherited from interface dev.demeng.pluginbase.terminable.Terminable
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Removes instances which have already been terminated.voidclose()Closes this composite terminable.booleanisClosed()Gets if the object represented by this instance is already permanently closed.with(AutoCloseable autoCloseable) Binds anAutoCloseablewith this composite closable.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.demeng.pluginbase.terminable.composite.CompositeTerminable
bind, closeAndReportException, closeSilently, withAll, withAllMethods inherited from interface dev.demeng.pluginbase.terminable.Terminable
bindWithMethods inherited from interface dev.demeng.pluginbase.terminable.TerminableConsumer
bindModule
-
Constructor Details
-
AbstractCompositeTerminable
protected AbstractCompositeTerminable()
-
-
Method Details
-
with
Description copied from interface:CompositeTerminableBinds anAutoCloseablewith this composite closable.Note that implementations do not keep track of duplicate contained terminables. If a single
AutoCloseableis added twice, it will beclosedtwice.- Specified by:
within interfaceCompositeTerminable- Parameters:
autoCloseable- the closable to bind- Returns:
- this (for chaining)
-
close
Description copied from interface:CompositeTerminableCloses this composite terminable.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCompositeTerminable- Specified by:
closein interfaceTerminable- Throws:
CompositeClosingException- if any of the sub-terminables throw an exception on close
-
isClosed
public boolean isClosed()Description copied from interface:TerminableGets if the object represented by this instance is already permanently closed.- Specified by:
isClosedin interfaceTerminable- Returns:
- true if this terminable is closed permanently
-
cleanup
public void cleanup()Description copied from interface:CompositeTerminableRemoves instances which have already been terminated.- Specified by:
cleanupin interfaceCompositeTerminable
-