public void close() throws IOException { delegate.close(); }
os.close(); } catch (IOException e) {
throw e; } finally { out.close();
public void close() throws IOException { delegate.close(); }
/** * Releases a previously held permit/lock on a message outputstream of a channel and also closes * the <code>messageOutputStream</code> * * @param messageOutputStream The message outputstream * @throws java.io.IOException */ public void releaseChannelMessageOutputStream(final MessageOutputStream messageOutputStream) throws IOException { try { messageOutputStream.close(); } finally { this.channelWriteSemaphore.release(); } }
protected static void writeResponse(final Channel channel, final ManagementRequestHeader header, final Exception error) throws IOException { final ManagementResponseHeader response = ManagementResponseHeader.create(header, error); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.write(ManagementProtocol.RESPONSE_END); output.close(); } finally { StreamUtils.safeClose(output); } }
/** * Write an error response. * * @param channel the channel * @param header the request * @param error the error * @throws IOException */ protected static void writeErrorResponse(final Channel channel, final ManagementRequestHeader header, final Exception error) throws IOException { final ManagementResponseHeader response = ManagementResponseHeader.create(header, error); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.close(); } finally { StreamUtils.safeClose(output); } }
protected static void writeResponse(final Channel channel, final ManagementRequestHeader header, final Exception error) throws IOException { final ManagementResponseHeader response = ManagementResponseHeader.create(header, error); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.write(ManagementProtocol.RESPONSE_END); output.close(); } finally { StreamUtils.safeClose(output); } }
/** * Write an error response. * * @param channel the channel * @param header the request * @param error the error * @throws IOException */ protected static void writeErrorResponse(final Channel channel, final ManagementRequestHeader header, final Throwable error) throws IOException { final ManagementResponseHeader response = ManagementResponseHeader.create(header, error); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.close(); } finally { StreamUtils.safeClose(output); } }
/** * Write an error response. * * @param channel the channel * @param header the request * @param error the error * @throws IOException */ protected static void writeErrorResponse(final Channel channel, final ManagementRequestHeader header, final Throwable error) throws IOException { final ManagementResponseHeader response = ManagementResponseHeader.create(header, error); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.close(); } finally { StreamUtils.safeClose(output); } }
protected static void writeResponse(final Channel channel, final ManagementRequestHeader header, final Exception error) throws IOException { final ManagementResponseHeader response = ManagementResponseHeader.create(header, error); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.write(ManagementProtocol.RESPONSE_END); output.close(); } finally { StreamUtils.safeClose(output); } }
protected static void writeResponse(final Channel channel, final ManagementRequestHeader header, final byte param) throws IOException { final ManagementResponseHeader response = ManagementResponseHeader.create(header); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.write(param); output.write(ManagementProtocol.RESPONSE_END); output.close(); } finally { StreamUtils.safeClose(output); } }
protected static void writeResponse(final Channel channel, final ManagementRequestHeader header, final byte param) throws IOException { final ManagementResponseHeader response = ManagementResponseHeader.create(header); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.write(param); output.write(ManagementProtocol.RESPONSE_END); output.close(); } finally { StreamUtils.safeClose(output); } }
protected static void writeResponse(final Channel channel, final ManagementRequestHeader header, final byte param) throws IOException { final ManagementResponseHeader response = ManagementResponseHeader.create(header); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.write(param); output.write(ManagementProtocol.RESPONSE_END); output.close(); } finally { StreamUtils.safeClose(output); } }
/** * Handle a simple ping request. * * @param channel the channel * @param header the protocol header * @throws IOException for any error */ private static void handlePing(final Channel channel, final ManagementProtocolHeader header) throws IOException { final ManagementProtocolHeader response = new ManagementPongHeader(header.getVersion()); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.close(); } finally { StreamUtils.safeClose(output); } }
/** * Handle a simple ping request. * * @param channel the channel * @param header the protocol header * @throws IOException for any error */ private static void handlePing(final Channel channel, final ManagementProtocolHeader header) throws IOException { final ManagementProtocolHeader response = new ManagementPongHeader(header.getVersion()); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.close(); } finally { StreamUtils.safeClose(output); } }
/** * Handle a simple ping request. * * @param channel the channel * @param header the protocol header * @throws IOException for any error */ protected static void handlePing(final Channel channel, final ManagementProtocolHeader header) throws IOException { final ManagementProtocolHeader response = new ManagementPongHeader(header.getVersion()); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.close(); } finally { StreamUtils.safeClose(output); } }
os.close(); } catch (IOException e) {
os.close(); } catch (IOException e) {
throw e; } finally { out.close();