public void setClosed() {
setValue(Boolean.TRUE);
}
}
final IoCloseFuture future = new Future(null);
session.close(immediately).addListener(new IoFutureListener<CloseFuture>() {
public void operationComplete(CloseFuture cf) {
future.setClosed();
}
});
return future;
}