@Override public boolean await(long timeoutMillis) throws InterruptedException { return delegate.await(timeoutMillis); }
@Override public ChannelPromise await() throws InterruptedException { delegate.await(); return this; }
@Override public boolean await(long timeout, TimeUnit unit) throws InterruptedException { return delegate.await(timeout, unit); }
@Override public ChannelPromise await() throws InterruptedException { delegate.await(); return this; }
@Override public boolean await(long timeout, TimeUnit unit) throws InterruptedException { return delegate.await(timeout, unit); }
@Override public boolean await(long timeoutMillis) throws InterruptedException { return delegate.await(timeoutMillis); }
@Override public ChannelPromise await() throws InterruptedException { delegate.await(); return this; }
@Override public boolean await(long timeout, TimeUnit unit) throws InterruptedException { return delegate.await(timeout, unit); }
@Override public boolean await(long timeoutMillis) throws InterruptedException { return delegate.await(timeoutMillis); }
private static void waitFor(ChannelPromise promise, long millis) { try { final boolean completed = promise.await(millis); if (!completed) { ActiveMQClientLogger.LOGGER.timeoutFlushingPacket(); } } catch (InterruptedException e) { throw new ActiveMQInterruptedException(e); } }
@Override public ClusterResponse sendRequest(ClusterRequest request) throws Exception { if (!isReady()) { throw new SentinelClusterException(ClusterErrorMessages.CLIENT_NOT_READY); } if (!validRequest(request)) { throw new SentinelClusterException(ClusterErrorMessages.BAD_REQUEST); } int xid = getCurrentId(); try { request.setId(xid); channel.writeAndFlush(request); ChannelPromise promise = channel.newPromise(); TokenClientPromiseHolder.putPromise(xid, promise); if (!promise.await(ClusterClientConfigManager.getRequestTimeout())) { throw new SentinelClusterException(ClusterErrorMessages.REQUEST_TIME_OUT); } SimpleEntry<ChannelPromise, ClusterResponse> entry = TokenClientPromiseHolder.getEntry(xid); if (entry == null || entry.getValue() == null) { // Should not go through here. throw new SentinelClusterException(ClusterErrorMessages.UNEXPECTED_STATUS); } return entry.getValue(); } finally { TokenClientPromiseHolder.remove(xid); } }
@Override public ChannelPromise await() throws InterruptedException { delegate.await(); return this; }
@Override public boolean await(long timeout, TimeUnit unit) throws InterruptedException { return delegate.await(timeout, unit); }
@Override public boolean await(long timeoutMillis) throws InterruptedException { return delegate.await(timeoutMillis); }
@Override public ChannelPromise await() throws InterruptedException { delegate.await(); return this; }
@Override public ChannelPromise await() throws InterruptedException { delegate.await(); return this; }
private static void waitFor(ChannelPromise promise, long millis) { try { final boolean completed = promise.await(millis); if (!completed) { ActiveMQClientLogger.LOGGER.timeoutFlushingPacket(); } } catch (InterruptedException e) { throw new ActiveMQInterruptedException(e); } }
private static void waitFor(ChannelPromise promise, long millis) { try { final boolean completed = promise.await(millis); if (!completed) { ActiveMQClientLogger.LOGGER.timeoutFlushingPacket(); } } catch (InterruptedException e) { throw new ActiveMQInterruptedException(e); } }
private static void waitFor(ChannelPromise promise, long millis) { try { final boolean completed = promise.await(millis); if (!completed) { ActiveMQClientLogger.LOGGER.timeoutFlushingPacket(); } } catch (InterruptedException e) { throw new ActiveMQInterruptedException(e); } }
private static void waitFor(ChannelPromise promise, long millis) { try { final boolean completed = promise.await(millis); if (!completed) { ActiveMQClientLogger.LOGGER.timeoutFlushingPacket(); } } catch (InterruptedException e) { throw new ActiveMQInterruptedException(e); } }