Search in sources :

Example 11 with UTF8Buffer

use of org.fusesource.hawtbuf.UTF8Buffer in project fabric8 by jboss-fuse.

the class BaseDataStreamMarshaller method looseUnmarsalThrowable.

protected Throwable looseUnmarsalThrowable(OpenWireFormat wireFormat, DataByteArrayInputStream dataIn) throws IOException {
    if (dataIn.readBoolean()) {
        UTF8Buffer clazz = looseUnmarshalString(dataIn);
        UTF8Buffer message = looseUnmarshalString(dataIn);
        Throwable o = createThrowable(clazz, message);
        if (wireFormat.isStackTraceEnabled()) {
            if (STACK_TRACE_ELEMENT_CONSTRUCTOR != null) {
                StackTraceElement[] ss = new StackTraceElement[dataIn.readShort()];
                for (int i = 0; i < ss.length; i++) {
                    try {
                        ss[i] = (StackTraceElement) STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[] { looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), Integer.valueOf(dataIn.readInt()) });
                    } catch (IOException e) {
                        throw e;
                    } catch (Throwable e) {
                    }
                }
                o.setStackTrace(ss);
            } else {
                short size = dataIn.readShort();
                for (int i = 0; i < size; i++) {
                    looseUnmarshalString(dataIn);
                    looseUnmarshalString(dataIn);
                    looseUnmarshalString(dataIn);
                    dataIn.readInt();
                }
            }
            o.initCause(looseUnmarsalThrowable(wireFormat, dataIn));
        }
        return o;
    } else {
        return null;
    }
}
Also used : UTF8Buffer(org.fusesource.hawtbuf.UTF8Buffer) IOException(java.io.IOException)

Aggregations

UTF8Buffer (org.fusesource.hawtbuf.UTF8Buffer)11 Buffer (org.fusesource.hawtbuf.Buffer)4 IOException (java.io.IOException)3 OpenwireException (io.fabric8.gateway.handlers.detecting.protocol.openwire.OpenwireException)2 ObjectSerializationStrategy (io.fabric8.dosgi.api.ObjectSerializationStrategy)1 Serialization (io.fabric8.dosgi.api.Serialization)1 SerializationStrategy (io.fabric8.dosgi.api.SerializationStrategy)1 ConnectionParameters (io.fabric8.gateway.handlers.loadbalancer.ConnectionParameters)1 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)1 Exchange (org.apache.camel.Exchange)1 BufferEditor (org.fusesource.hawtbuf.BufferEditor)1 DataByteArrayOutputStream (org.fusesource.hawtbuf.DataByteArrayOutputStream)1 Callback (org.fusesource.mqtt.client.Callback)1 Listener (org.fusesource.mqtt.client.Listener)1 CONNECT (org.fusesource.mqtt.codec.CONNECT)1 MQTTFrame (org.fusesource.mqtt.codec.MQTTFrame)1 Buffer (org.vertx.java.core.buffer.Buffer)1