public interface CloseFuture extends IoFuture
IoFuture
for asynchronous close requests.
IoSession session = ...; CloseFuture future = session.close(true); // Wait until the connection is closed future.awaitUninterruptibly(); // Now connection should be closed. assert future.isClosed();
Modifier and Type | Method and Description |
---|---|
CloseFuture |
addListener(IoFutureListener<?> listener)
Adds an event listener which is notified when
this future is completed.
|
CloseFuture |
await()
Wait for the asynchronous operation to complete.
|
CloseFuture |
awaitUninterruptibly()
Wait for the asynchronous operation to complete uninterruptibly.
|
boolean |
isClosed() |
CloseFuture |
removeListener(IoFutureListener<?> listener)
Removes an existing event listener so it won't be notified when
the future is completed.
|
void |
setClosed()
Marks this future as closed and notifies all threads waiting for this
future.
|
await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, isDone, join, join
boolean isClosed()
void setClosed()
CloseFuture await() throws InterruptedException
await
in interface IoFuture
InterruptedException
- If the thread is interrupted while waitingCloseFuture awaitUninterruptibly()
awaitUninterruptibly
in interface IoFuture
CloseFuture addListener(IoFutureListener<?> listener)
addListener
in interface IoFuture
listener
- The listener to addCloseFuture removeListener(IoFutureListener<?> listener)
removeListener
in interface IoFuture
listener
- The listener to removeCopyright © 2004–2021 Apache MINA Project. All rights reserved.