Examples of WireFormatInfo


Examples of org.apache.activemq.apollo.openwire.command.WireFormatInfo

     * @throws IOException thrown if an error occurs
     */
    public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
        super.tightMarshal2(wireFormat, o, dataOut, bs);

        WireFormatInfo info = (WireFormatInfo)o;
        tightMarshalConstByteArray2(info.getMagic(), dataOut, bs, 8);
        dataOut.writeInt(info.getVersion());
        tightMarshalByteSequence2(info.getMarshalledProperties(), dataOut, bs);

        info.afterMarshall(wireFormat);

    }
View Full Code Here

Examples of org.apache.activemq.apollo.openwire.command.WireFormatInfo

     * @throws IOException
     */
    public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
        super.looseUnmarshal(wireFormat, o, dataIn);

        WireFormatInfo info = (WireFormatInfo)o;

        info.beforeUnmarshall(wireFormat);
       
        info.setMagic(looseUnmarshalConstByteArray(dataIn, 8));
        info.setVersion(dataIn.readInt());
        info.setMarshalledProperties(looseUnmarshalByteSequence(dataIn));

        info.afterUnmarshall(wireFormat);

    }
View Full Code Here

Examples of org.apache.activemq.apollo.openwire.command.WireFormatInfo

    /**
     * Write the booleans that this object uses to a BooleanStream
     */
    public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

        WireFormatInfo info = (WireFormatInfo)o;

        info.beforeMarshall(wireFormat);

        super.looseMarshal(wireFormat, o, dataOut);
        looseMarshalConstByteArray(wireFormat, info.getMagic(), dataOut, 8);
        dataOut.writeInt(info.getVersion());
        looseMarshalByteSequence(wireFormat, info.getMarshalledProperties(), dataOut);

    }
View Full Code Here

Examples of org.apache.activemq.command.WireFormatInfo

    private boolean sizePrefixDisabled;
    private long maxInactivityDuration = 30 * 1000;
    private int cacheSize = 1024;

    public WireFormat createWireFormat() {
        WireFormatInfo info = new WireFormatInfo();
        info.setVersion(version);

        try {
            info.setStackTraceEnabled(stackTraceEnabled);
            info.setCacheEnabled(cacheEnabled);
            info.setTcpNoDelayEnabled(tcpNoDelayEnabled);
            info.setTightEncodingEnabled(tightEncodingEnabled);
            info.setSizePrefixDisabled(sizePrefixDisabled);
            info.seMaxInactivityDuration(maxInactivityDuration);
            info.setCacheSize(cacheSize);
        } catch (Exception e) {
            IllegalStateException ise = new IllegalStateException("Could not configure WireFormatInfo");
            ise.initCause(e);
            throw ise;
        }
View Full Code Here

Examples of org.apache.activemq.command.WireFormatInfo

    public void start() throws Exception {
        super.start();
        if (firstStart.compareAndSet(true, false)) {
            try {
                WireFormatInfo info = wireFormat.getPreferedWireFormatInfo();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Sending: " + info);
                }
                sendWireFormat(info);
            } finally {
View Full Code Here

Examples of org.apache.activemq.command.WireFormatInfo

    }

    public void onCommand(Object o) {
        Command command = (Command)o;
        if (command.isWireFormatInfo()) {
            WireFormatInfo info = (WireFormatInfo)command;
            if (LOG.isDebugEnabled()) {
                LOG.debug("Received WireFormat: " + info);
            }

            try {
                wireInfoSentDownLatch.await();

                if (LOG.isDebugEnabled()) {
                    LOG.debug(this + " before negotiation: " + wireFormat);
                }
                if (!info.isValid()) {
                    onException(new IOException("Remote wire format magic is invalid"));
                } else if (info.getVersion() < minimumVersion) {
                    onException(new IOException("Remote wire format (" + info.getVersion() + ") is lower the minimum version required (" + minimumVersion + ")"));
                }

                wireFormat.renegotiateWireFormat(info);
                Socket socket = next.narrow(Socket.class);
                if (socket != null) {
View Full Code Here

Examples of org.apache.activemq.command.WireFormatInfo

        // Read the command directly from the reader, assuming UTF8 encoding
        ServletInputStream sis = request.getInputStream();
        Command command = (Command) wireFormat.unmarshalText(new InputStreamReader(sis, "UTF-8"));

        if (command instanceof WireFormatInfo) {
            WireFormatInfo info = (WireFormatInfo) command;
            if (!canProcessWireFormatVersion(info.getVersion())) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot process wire format of version: "
                        + info.getVersion());
            }

        } else {

            BlockingQueueTransport transport = getTransportChannel(request, response);
View Full Code Here

Examples of org.apache.activemq.command.WireFormatInfo

    public void start() throws Exception {
        super.start();
        if (firstStart.compareAndSet(true, false)) {
            try {
                WireFormatInfo info = wireFormat.getPreferedWireFormatInfo();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Sending: " + info);
                }
                sendWireFormat(info);
            } finally {
View Full Code Here

Examples of org.apache.activemq.command.WireFormatInfo

    }

    public void onCommand(Object o) {
        Command command = (Command)o;
        if (command.isWireFormatInfo()) {
            WireFormatInfo info = (WireFormatInfo)command;
            if (LOG.isDebugEnabled()) {
                LOG.debug("Received WireFormat: " + info);
            }

            try {
                wireInfoSentDownLatch.await();

                if (LOG.isDebugEnabled()) {
                    LOG.debug(this + " before negotiation: " + wireFormat);
                }
                if (!info.isValid()) {
                    onException(new IOException("Remote wire format magic is invalid"));
                } else if (info.getVersion() < minimumVersion) {
                    onException(new IOException("Remote wire format (" + info.getVersion() + ") is lower the minimum version required (" + minimumVersion + ")"));
                }

                wireFormat.renegotiateWireFormat(info);
                Socket socket = next.narrow(Socket.class);
                if (socket != null) {
View Full Code Here

Examples of org.apache.activemq.command.WireFormatInfo

        // Read the command directly from the reader, assuming UTF8 encoding
        Command command = (Command) wireFormat.unmarshalText(new InputStreamReader(stream, "UTF-8"));

        if (command instanceof WireFormatInfo) {
            WireFormatInfo info = (WireFormatInfo) command;
            if (!canProcessWireFormatVersion(info.getVersion())) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot process wire format of version: "
                        + info.getVersion());
            }

        } else {

            BlockingQueueTransport transport = getTransportChannel(request, response);
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.