@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return promise.get(timeout, unit); }
@Override public T get() throws InterruptedException, ExecutionException { return promise.get(); }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return promise.get(timeout, unit); }
@Override public T get() throws InterruptedException, ExecutionException { return promise.get(); }
@Override public T get(long timeout, TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException { return promise.get(timeout, unit); }
@Override public T get() throws ExecutionException, InterruptedException { return promise.get(); }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, java.util.concurrent.TimeoutException { return delegate.get(timeout, unit); } }
@Override public T get() throws InterruptedException, ExecutionException { return delegate.get(); }
clientId, secret, protocol).get(); this.running = true;
private void fireStateChange(State newState, Listener<T> listener) { switch (newState) { case SENT: break; case QUEUED: listener.onJobQueued(this); break; case STARTED: listener.onJobStarted(this); break; case CANCELLED: listener.onJobCancelled(this); break; case FAILED: listener.onJobFailed(this, promise.cause()); break; case SUCCEEDED: try { listener.onJobSucceeded(this, promise.get()); } catch (Exception e) { // Shouldn't really happen. throw new IllegalStateException(e); } break; default: throw new IllegalStateException(); } }
@Override public T get(long timeout, TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException { return promise.get(timeout, unit); }
@Override public T get(long timeout, TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException { return promise.get(timeout, unit); }
@Override public T get(long timeout, TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException { return promise.get(timeout, unit); }
@Override public T get() throws ExecutionException, InterruptedException { return promise.get(); }
@Override public T get() throws ExecutionException, InterruptedException { return promise.get(); }
@Override public T get() throws ExecutionException, InterruptedException { return promise.get(); }
public void testLocalAddressAfterConnect(ServerBootstrap sb, Bootstrap cb) throws Throwable { Channel serverChannel = null; Channel clientChannel = null; try { final Promise<InetSocketAddress> localAddressPromise = ImmediateEventExecutor.INSTANCE.newPromise(); serverChannel = sb.childHandler(new ChannelInboundHandlerAdapter() { @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { localAddressPromise.setSuccess((InetSocketAddress) ctx.channel().localAddress()); } }).bind().syncUninterruptibly().channel(); clientChannel = cb.handler(new ChannelInboundHandlerAdapter()).register().syncUninterruptibly().channel(); assertNull(clientChannel.localAddress()); assertNull(clientChannel.remoteAddress()); clientChannel.connect(serverChannel.localAddress()).syncUninterruptibly().channel(); assertLocalAddress((InetSocketAddress) clientChannel.localAddress()); assertNotNull(clientChannel.remoteAddress()); assertLocalAddress(localAddressPromise.get()); } finally { if (clientChannel != null) { clientChannel.close().syncUninterruptibly(); } if (serverChannel != null) { serverChannel.close().syncUninterruptibly(); } } }
private void fireStateChange(State s, Listener l) { switch (s) { case SENT: break; case QUEUED: l.onJobQueued(this); break; case STARTED: l.onJobStarted(this); break; case CANCELLED: l.onJobCancelled(this); break; case FAILED: l.onJobFailed(this, promise.cause()); break; case SUCCEEDED: try { l.onJobSucceeded(this, promise.get()); } catch (Exception e) { // Shouldn't really happen. throw new IllegalStateException(e); } break; default: throw new IllegalStateException(); } }
private void fireStateChange(State s, Listener l) { switch (s) { case SENT: break; case QUEUED: l.onJobQueued(this); break; case STARTED: l.onJobStarted(this); break; case CANCELLED: l.onJobCancelled(this); break; case FAILED: l.onJobFailed(this, promise.cause()); break; case SUCCEEDED: try { l.onJobSucceeded(this, promise.get()); } catch (Exception e) { // Shouldn't really happen. throw new IllegalStateException(e); } break; default: throw new IllegalStateException(); } }