Java 类io.netty.util.concurrent.SucceededFuture 实例源码

项目:jannel    文件:JannelClientTest.java   
@Test
@SuppressWarnings("unchecked")
public void testDestroy() throws Exception {
    Future<String> future = new SucceededFuture<String>(ImmediateEventExecutor.INSTANCE, "test");
    when(eventLoopGroup.shutdownGracefully()).thenReturn((Future) future);
    jannelClient.destroy();

    verify(eventLoopGroup).shutdownGracefully();
}
项目:meshy    文件:MeshyClientHelper.java   
@Override public Future<?> closeAsync() {
    synchronized (meshyClients) {
        if (refCount.decrementAndGet() == 0) {
            meshyClients.remove(key);
            return super.closeAsync();
        } else {
            return new SucceededFuture<>(GlobalEventExecutor.INSTANCE, null);
        }
    }
}
项目:lettuce-core    文件:EmptyClientResources.java   
@Override
public Future<Boolean> shutdown() {
    return new SucceededFuture<>(GlobalEventExecutor.INSTANCE, true);
}
项目:lettuce-core    文件:EmptyClientResources.java   
@Override
public Future<Boolean> shutdown(long quietPeriod, long timeout, TimeUnit timeUnit) {
    return new SucceededFuture<>(GlobalEventExecutor.INSTANCE, true);
}