protected boolean isConnected() { return super.isConnected(); }
@Override public Channel getChannel() throws IOException { final Channel channel = this.channel; if(channel == null && state != State.OPEN) { throw channelClosed(); } return channel; }
/** * Open a channel. * * @param connection the connection * @param serviceType the service type * @param options the channel options * @return the opened channel * @throws IOException if there is a remoting problem opening the channel or it cannot be opened in a reasonable amount of time */ protected Channel openChannel(final Connection connection, final String serviceType, final OptionMap options) throws IOException { return openChannel(connection, serviceType, options, null); }
@Override public void close() throws IOException { try { super.close(); } finally { connectionManager.shutdown(); } }
@Override public Channel getChannel() throws IOException { final Channel channel = super.getChannel(); if(channel == null) { // Fail fast, don't try to await a new channel throw ProtocolMessages.MESSAGES.channelClosed(); } return channel; }
@Override public void close() throws IOException { try { connectionManager.shutdown(); } finally { super.close(); } }
@Override public Channel getChannel() throws IOException { final Channel channel = super.getChannel(); if(channel == null) { // Fail fast, don't try to await a new channel throw channelClosed(); } return channel; }
@Override public void close() throws IOException { try { connectionManager.shutdown(); } finally { super.close(); } }
@Override public Channel getChannel() throws IOException { final Channel channel = super.getChannel(); if(channel == null) { // Fail fast, don't try to await a new channel throw channelClosed(); } return channel; }
protected boolean isConnected() { return super.isConnected(); }
@Override public Channel getChannel() throws IOException { final Channel channel = this.channel; if(channel == null && state != State.OPEN) { throw channelClosed(); } return channel; }
/** * Open a channel. * * @param connection the connection * @param serviceType the service type * @param options the channel options * @return the opened channel * @throws IOException if there is a remoting problem opening the channel or it cannot be opened in a reasonable amount of time */ protected Channel openChannel(final Connection connection, final String serviceType, final OptionMap options) throws IOException { return openChannel(connection, serviceType, options, null); }
@Override public void close() throws IOException { try { super.close(); } finally { connectionManager.shutdown(); } }
@Override public Channel getChannel() throws IOException { final Channel channel = super.getChannel(); if(channel == null) { // Fail fast, don't try to await a new channel throw ProtocolMessages.MESSAGES.channelClosed(); } return channel; }
protected boolean isConnected() { return super.isConnected(); }
@Override public void close() throws IOException { try { super.close(); } finally { connectionManager.shutdown(); } }
@Override public Channel getChannel() throws IOException { Channel channel = super.getChannel(); if(channel != null) { return channel; } // Try to connect and wait for the channel connectionManager.connect(); // In case connect did not succeed the next getChannel() call needs to try to reconnect channel = super.getChannel(); if(channel == null) { throw ProtocolMessages.MESSAGES.channelClosed(); } return channel; }
@Override public void close() throws IOException { try { super.close(); final ReconnectRunner reconnectTask = this.reconnectRunner; if (reconnectTask != null) { this.reconnectRunner = null; reconnectTask.cancel(); } } finally { connectionManager.shutdown(); } }
@Override public Channel getChannel() throws IOException { Channel channel = super.getChannel(); if(channel != null) { return channel; } // Try to connect and wait for the channel synchronized (connectionManager) { deadline = System.currentTimeMillis() + timeout; // read in openChannel below connectionManager.connect(); deadline = null; } // In case connect did not succeed the next getChannel() call needs to try to reconnect channel = super.getChannel(); if(channel == null) { throw ProtocolLogger.ROOT_LOGGER.channelClosed(); } return channel; }
@Override public void close() throws IOException { try { super.close(); final ReconnectRunner reconnectTask = this.reconnectRunner; if (reconnectTask != null) { this.reconnectRunner = null; reconnectTask.cancel(); } } finally { connectionManager.shutdown(); } }