Examples of CancellableDataOutputStream


Examples of org.jboss.remoting3.jmx.protocol.CancellableDataOutputStream

        marshallingConfiguration.setClassResolver(classResolver);
        return marshallerFactory.createUnmarshaller(marshallingConfiguration);
    }

    protected void write(MessageWriter writer) throws IOException {
        CancellableDataOutputStream output = new CancellableDataOutputStream(channel.writeMessage());
        try {
            writer.write(output);
        } catch (IOException e) {
            output.cancel();
            throw e;
        } finally {
            IoUtils.safeClose(output);
        }
    }
View Full Code Here

Examples of org.jboss.remoting3.jmx.protocol.CancellableDataOutputStream

     *
     * @param channel
     * @throws IOException
     */
    private void writeHeader(final Channel channel) throws IOException {
        CancellableDataOutputStream dos = new CancellableDataOutputStream(channel.writeMessage());
        try {
            dos.writeBytes("JMX");
            byte[] versions = Versions.getSupportedVersions();
            dos.writeInt(versions.length);
            dos.write(versions);
            if (Version.isSnapshot()) {
                dos.write(SNAPSHOT);
            } else {
                dos.write(STABLE);
            }
        } catch (IOException e) {
            dos.cancel();
            throw e;
        } finally {
            dos.close();
        }
    }
View Full Code Here

Examples of org.jboss.remotingjmx.protocol.CancellableDataOutputStream

        marshallingConfiguration.setClassResolver(classResolver);
        return marshallerFactory.createUnmarshaller(marshallingConfiguration);
    }

    protected void write(MessageWriter writer) throws IOException {
        CancellableDataOutputStream output = new CancellableDataOutputStream(channel.writeMessage());
        try {
            writer.write(output);
        } catch (IOException e) {
            output.cancel();
            throw e;
        } finally {
            IoUtils.safeClose(output);
        }
    }
View Full Code Here

Examples of org.jboss.remotingjmx.protocol.CancellableDataOutputStream

        marshallingConfiguration.setClassResolver(classResolver);
        return marshallerFactory.createUnmarshaller(marshallingConfiguration);
    }

    protected void write(MessageWriter writer) throws IOException {
        CancellableDataOutputStream output = new CancellableDataOutputStream(channel.writeMessage());
        try {
            writer.write(output);
        } catch (IOException e) {
            output.cancel();
            throw e;
        } finally {
            IoUtils.safeClose(output);
        }
    }
View Full Code Here

Examples of org.jboss.remotingjmx.protocol.CancellableDataOutputStream

            return future;
        }

        private void sendVersionZeroHeader(Channel channel) throws IOException {
            log.debug("Selecting version 0x00 to receive full version list.");
            CancellableDataOutputStream dos = new CancellableDataOutputStream(channel.writeMessage());
            try {
                dos.writeBytes(JMX);
                dos.writeByte(0x00);
                String remotingJMXVersion = Version.getVersionString();
                byte[] versionBytes = remotingJMXVersion.getBytes("UTF-8");
                dos.writeInt(versionBytes.length);
                dos.write(versionBytes);
            } catch (IOException e) {
                dos.cancel();
                throw e;
            } finally {
                IoUtils.safeClose(dos);
            }
        }
View Full Code Here

Examples of org.jboss.remotingjmx.protocol.CancellableDataOutputStream

     *
     * @param channel
     * @throws IOException
     */
    private void writeVersionHeader(final Channel channel, final boolean fullVersionList) throws IOException {
        CancellableDataOutputStream dos = new CancellableDataOutputStream(channel.writeMessage());
        try {
            dos.writeBytes(JMX);
            byte[] versions = getSupportedVersions(fullVersionList);
            dos.writeInt(versions.length);
            dos.write(versions);
            if (Version.isSnapshot()) {
                dos.write(SNAPSHOT);
            } else {
                dos.write(STABLE);
            }

            if (fullVersionList) {
                String remotingJMXVersion = Version.getVersionString();
                byte[] versionBytes = remotingJMXVersion.getBytes("UTF-8");
                dos.writeInt(versionBytes.length);
                dos.write(versionBytes);
            }
        } catch (IOException e) {
            dos.cancel();
            throw e;
        } finally {
            dos.close();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.