Class CloseableTask<C extends java.io.Closeable>
- java.lang.Object
-
- de.dytanic.cloudnet.ext.storage.ftp.storage.queue.CloseableTask<C>
-
- All Implemented Interfaces:
de.dytanic.cloudnet.common.concurrent.ITask<C>,java.io.Closeable,java.lang.AutoCloseable,java.util.concurrent.Callable<C>,java.util.concurrent.Future<C>
@NotNull public class CloseableTask<C extends java.io.Closeable> extends java.lang.Object implements de.dytanic.cloudnet.common.concurrent.ITask<C>, java.io.Closeable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull de.dytanic.cloudnet.common.concurrent.ITask<C>addListener(de.dytanic.cloudnet.common.concurrent.ITaskListener<C> listener)Ccall()booleancancel(boolean mayInterruptIfRunning)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<C>clearListeners()voidclose()Cget()Cget(long timeout, @NotNull java.util.concurrent.TimeUnit unit)Cget(long time, java.util.concurrent.TimeUnit timeUnit, C def)java.util.concurrent.Callable<C>getCallable()CgetDef(C def)java.util.Collection<de.dytanic.cloudnet.common.concurrent.ITaskListener<C>>getListeners()booleanisCancelled()booleanisDone()<T> de.dytanic.cloudnet.common.concurrent.ITask<T>mapThrowable(de.dytanic.cloudnet.common.concurrent.function.ThrowableFunction<C,T,java.lang.Throwable> mapper)java.io.InputStreamtoInputStream()java.io.OutputStreamtoOutputStream()
-
-
-
Method Detail
-
toOutputStream
public java.io.OutputStream toOutputStream()
-
toInputStream
public java.io.InputStream toInputStream()
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
addListener
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<C> addListener(de.dytanic.cloudnet.common.concurrent.ITaskListener<C> listener)
- Specified by:
addListenerin interfacede.dytanic.cloudnet.common.concurrent.ITask<C extends java.io.Closeable>
-
clearListeners
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<C> clearListeners()
- Specified by:
clearListenersin interfacede.dytanic.cloudnet.common.concurrent.ITask<C extends java.io.Closeable>
-
getListeners
public java.util.Collection<de.dytanic.cloudnet.common.concurrent.ITaskListener<C>> getListeners()
- Specified by:
getListenersin interfacede.dytanic.cloudnet.common.concurrent.ITask<C extends java.io.Closeable>
-
getCallable
public java.util.concurrent.Callable<C> getCallable()
- Specified by:
getCallablein interfacede.dytanic.cloudnet.common.concurrent.ITask<C extends java.io.Closeable>
-
getDef
public C getDef(C def)
- Specified by:
getDefin interfacede.dytanic.cloudnet.common.concurrent.ITask<C extends java.io.Closeable>
-
get
public C get(long time, java.util.concurrent.TimeUnit timeUnit, C def)
- Specified by:
getin interfacede.dytanic.cloudnet.common.concurrent.ITask<C extends java.io.Closeable>
-
mapThrowable
public <T> de.dytanic.cloudnet.common.concurrent.ITask<T> mapThrowable(de.dytanic.cloudnet.common.concurrent.function.ThrowableFunction<C,T,java.lang.Throwable> mapper)
- Specified by:
mapThrowablein interfacede.dytanic.cloudnet.common.concurrent.ITask<C extends java.io.Closeable>
-
call
public C call()
- Specified by:
callin interfacejava.util.concurrent.Callable<C extends java.io.Closeable>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancelin interfacejava.util.concurrent.Future<C extends java.io.Closeable>
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfacejava.util.concurrent.Future<C extends java.io.Closeable>
-
isDone
public boolean isDone()
- Specified by:
isDonein interfacejava.util.concurrent.Future<C extends java.io.Closeable>
-
get
public C get()
- Specified by:
getin interfacejava.util.concurrent.Future<C extends java.io.Closeable>
-
-