@Override public Connection connect() throws IOException { throw ProtocolMessages.MESSAGES.channelClosed(); }
@Override public Channel getChannel() throws IOException { if(closed) { throw ProtocolMessages.MESSAGES.channelClosed(); } return channel; }
@Override public Channel getChannel() throws IOException { final Channel channel = this.channel; if(channel == null && closed) { throw ProtocolMessages.MESSAGES.channelClosed(); } return channel; }
@Override public <T extends Operation> AsyncFuture<ModelNode> execute(TransactionalOperationListener<T> listener, T operation) throws IOException { throw ProtocolMessages.MESSAGES.channelClosed(); }
@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 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; }
/** * Get the underlying channel. This may block until the channel is set. * * @return the channel * @throws IOException for any error */ protected Channel awaitChannel() throws IOException { Channel channel = this.channel; if(channel != null) { return channel; } synchronized (lock) { for(;;) { if(closed) { throw ProtocolMessages.MESSAGES.channelClosed(); } channel = this.channel; if(channel != null) { return channel; } try { lock.wait(); } catch (InterruptedException e) { throw new IOException(e); } } } }
@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; }
Connection connection; synchronized (this) { if(shutdown) throw ProtocolMessages.MESSAGES.channelClosed(); connection = this.connection; if(connection == null) { connection = connectTask.connect(); if(connection == null) { throw ProtocolMessages.MESSAGES.channelClosed();