Package io.activej.async.process
Class AbstractAsyncCloseable
- java.lang.Object
-
- io.activej.async.process.AbstractAsyncCloseable
-
- All Implemented Interfaces:
AsyncCloseable
public abstract class AbstractAsyncCloseable extends Object implements AsyncCloseable
-
-
Field Summary
Fields Modifier and Type Field Description protected Eventloopeventloop-
Fields inherited from interface io.activej.async.process.AsyncCloseable
STATIC
-
-
Constructor Summary
Constructors Constructor Description AbstractAsyncCloseable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseEx(@NotNull Throwable e)Closes process exceptionally in case an exception is thrown while executing the given process.ThrowablegetException()booleanisClosed()protected voidonCleanup()protected voidonClosed(@NotNull Throwable e)<T> @NotNull Promise<T>sanitize(Promise<T> promise)<T> @NotNull Promise<T>sanitize(T value, @Nullable Throwable e)voidsetCloseable(@Nullable AsyncCloseable closeable)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.activej.async.process.AsyncCloseable
close
-
-
-
-
Field Detail
-
eventloop
protected final Eventloop eventloop
-
-
Method Detail
-
getException
public Throwable getException()
-
setCloseable
public final void setCloseable(@Nullable @Nullable AsyncCloseable closeable)
-
onClosed
protected void onClosed(@NotNull @NotNull Throwable e)
-
onCleanup
protected void onCleanup()
-
closeEx
public final void closeEx(@NotNull @NotNull Throwable e)Description copied from interface:AsyncCloseableCloses process exceptionally in case an exception is thrown while executing the given process.- Specified by:
closeExin interfaceAsyncCloseable- Parameters:
e- exception that is used to close process with
-
isClosed
public final boolean isClosed()
-
-