/** * Write the header information to the provided {@link java.io.DataOutput}. * * @param output The output to write to * @throws IOException If any problems occur writing to the output */ public void write(final DataOutput output) throws IOException { output.write(ManagementProtocol.SIGNATURE); output.writeByte(ManagementProtocol.VERSION_FIELD); output.writeInt(getVersion()); output.writeByte(ManagementProtocol.TYPE); output.writeByte(getType()); }
/** * Write the header information to the provided {@link java.io.DataOutput}. * * @param output The output to write to * @throws IOException If any problems occur writing to the output */ public void write(final DataOutput output) throws IOException { output.write(ManagementProtocol.SIGNATURE); output.writeByte(ManagementProtocol.VERSION_FIELD); output.writeInt(getVersion()); output.writeByte(ManagementProtocol.TYPE); output.writeByte(getType()); }
/** * Write the header information to the provided {@link java.io.DataOutput}. * * @param output The output to write to * @throws IOException If any problems occur writing to the output */ public void write(final DataOutput output) throws IOException { output.write(ManagementProtocol.SIGNATURE); output.writeByte(ManagementProtocol.VERSION_FIELD); output.writeInt(getVersion()); output.writeByte(ManagementProtocol.TYPE); output.writeByte(getType()); }
protected static void safeWriteResponse(final Channel channel, final ManagementProtocolHeader header, byte param) { if(header.getType() == ManagementProtocol.TYPE_REQUEST) { try { writeResponse(channel, (ManagementRequestHeader) header, param); } catch(IOException ioe) { HostControllerLogger.ROOT_LOGGER.tracef(ioe, "failed to write error response for %s on channel: %s", header, channel); } } }
protected static void safeWriteResponse(final Channel channel, final ManagementProtocolHeader header, final Exception error) { if(header.getType() == ManagementProtocol.TYPE_REQUEST) { try { writeResponse(channel, (ManagementRequestHeader) header, error); } catch(IOException ioe) { HostControllerLogger.ROOT_LOGGER.tracef(ioe, "failed to write error response for %s on channel: %s", header, channel); } } }
protected static void safeWriteResponse(final Channel channel, final ManagementProtocolHeader header, final Exception error) { if(header.getType() == ManagementProtocol.TYPE_REQUEST) { try { writeResponse(channel, (ManagementRequestHeader) header, error); } catch(IOException ioe) { HostControllerLogger.ROOT_LOGGER.tracef(ioe, "failed to write error response for %s on channel: %s", header, channel); } } }
protected static void safeWriteResponse(final Channel channel, final ManagementProtocolHeader header, byte param) { if(header.getType() == ManagementProtocol.TYPE_REQUEST) { try { writeResponse(channel, (ManagementRequestHeader) header, param); } catch(IOException ioe) { HostControllerLogger.ROOT_LOGGER.tracef(ioe, "failed to write error response for %s on channel: %s", header, channel); } } }
protected static void safeWriteResponse(final Channel channel, final ManagementProtocolHeader header, final Exception error) { if(header.getType() == ManagementProtocol.TYPE_REQUEST) { try { writeResponse(channel, (ManagementRequestHeader) header, error); } catch(IOException ioe) { ProtocolLogger.ROOT_LOGGER.tracef(ioe, "failed to write error response for %s on channel: %s", header, channel); } } }
protected static void safeWriteResponse(final Channel channel, final ManagementProtocolHeader header, byte param) { if(header.getType() == ManagementProtocol.TYPE_REQUEST) { try { writeResponse(channel, (ManagementRequestHeader) header, param); } catch(IOException ioe) { ProtocolLogger.ROOT_LOGGER.tracef(ioe, "failed to write error response for %s on channel: %s", header, channel); } } }
/** * Safe write error response. * * @param channel the channel * @param header the request header * @param error the exception */ protected static void safeWriteErrorResponse(final Channel channel, final ManagementProtocolHeader header, final Exception error) { if(header.getType() == ManagementProtocol.TYPE_REQUEST) { try { writeErrorResponse(channel, (ManagementRequestHeader) header, error); } catch(IOException ioe) { ProtocolLogger.ROOT_LOGGER.tracef(ioe, "failed to write error response for %s on channel: %s", header, channel); } } }
/** * Safe write error response. * * @param channel the channel * @param header the request header * @param error the exception */ protected static void safeWriteErrorResponse(final Channel channel, final ManagementProtocolHeader header, final Throwable error) { if(header.getType() == ManagementProtocol.TYPE_REQUEST) { try { writeErrorResponse(channel, (ManagementRequestHeader) header, error); } catch(IOException ioe) { ProtocolLogger.ROOT_LOGGER.tracef(ioe, "failed to write error response for %s on channel: %s", header, channel); } } }
/** * Safe write error response. * * @param channel the channel * @param header the request header * @param error the exception */ protected static void safeWriteErrorResponse(final Channel channel, final ManagementProtocolHeader header, final Throwable error) { if(header.getType() == ManagementProtocol.TYPE_REQUEST) { try { writeErrorResponse(channel, (ManagementRequestHeader) header, error); } catch(IOException ioe) { ProtocolLogger.ROOT_LOGGER.tracef(ioe, "failed to write error response for %s on channel: %s", header, channel); } } }
final DataInput input = new DataInputStream(message); final ManagementProtocolHeader header = ManagementProtocolHeader.parse(input); final byte type = header.getType(); try { if (type == ManagementProtocol.TYPE_PING) {
final DataInput input = new DataInputStream(message); final ManagementProtocolHeader header = ManagementProtocolHeader.parse(input); final byte type = header.getType(); if(type == ManagementProtocol.TYPE_PING) {
final DataInput input = new DataInputStream(message); final ManagementProtocolHeader header = ManagementProtocolHeader.parse(input); final byte type = header.getType(); try { if (type == ManagementProtocol.TYPE_PING) {
final byte type = header.getType(); if(type == ManagementProtocol.TYPE_RESPONSE) {
final byte type = header.getType(); if(type == ManagementProtocol.TYPE_RESPONSE) {
final byte type = header.getType(); if(type == ManagementProtocol.TYPE_RESPONSE) {