Package org.fusesource.hawtbuf

Examples of org.fusesource.hawtbuf.UTF8Buffer


        FutureConnection connection = mqtt.futureConnection();
        connection.connect().await();

        final LinkedList<Future<Void>> queue = new LinkedList<Future<Void>>();
        UTF8Buffer topic = new UTF8Buffer(destination);
        for( int i=1; i <= messages; i ++) {

            // Send the publish without waiting for it to complete. This allows us
            // to send multiple message without blocking..
            queue.add(connection.publish(topic, msg, QoS.AT_LEAST_ONCE, false));
View Full Code Here


  public ActiveMQDestination() {
  }

  protected ActiveMQDestination(String name) {
      setPhysicalName(new UTF8Buffer(name));
  }
View Full Code Here

    }

    protected Throwable tightUnmarsalThrowable(OpenWireFormat wireFormat, DataByteArrayInputStream dataIn, BooleanStream bs)
        throws IOException {
        if (bs.readBoolean()) {
            UTF8Buffer clazz = tightUnmarshalString(dataIn, bs);
            UTF8Buffer message = tightUnmarshalString(dataIn, bs);
            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++) {
View Full Code Here

            bs.writeBoolean(false);
            return 0;
        } else {
            int rc = 0;
            bs.writeBoolean(true);
            rc += tightMarshalString1(new UTF8Buffer(o.getClass().getName()), bs);
            rc += tightMarshalString1(new UTF8Buffer(o.getMessage()), bs);
            if (wireFormat.isStackTraceEnabled()) {
                rc += 2;
                StackTraceElement[] stackTrace = o.getStackTrace();
                for (int i = 0; i < stackTrace.length; i++) {
                    StackTraceElement element = stackTrace[i];
                    rc += tightMarshalString1(new UTF8Buffer(element.getClassName()), bs);
                    rc += tightMarshalString1(new UTF8Buffer(element.getMethodName()), bs);
                    rc += tightMarshalString1(new UTF8Buffer(element.getFileName()), bs);
                    rc += 4;
                }
                rc += tightMarshalThrowable1(wireFormat, o.getCause(), bs);
            }
            return rc;
View Full Code Here

    }

    protected void tightMarshalThrowable2(OpenWireFormat wireFormat, Throwable o, DataByteArrayOutputStream dataOut,
                                          BooleanStream bs) throws IOException {
        if (bs.readBoolean()) {
            tightMarshalString2(new UTF8Buffer(o.getClass().getName()), dataOut, bs);
            tightMarshalString2(new UTF8Buffer(o.getMessage()), dataOut, bs);
            if (wireFormat.isStackTraceEnabled()) {
                StackTraceElement[] stackTrace = o.getStackTrace();
                dataOut.writeShort(stackTrace.length);
                for (int i = 0; i < stackTrace.length; i++) {
                    StackTraceElement element = stackTrace[i];
                    tightMarshalString2(new UTF8Buffer(element.getClassName()), dataOut, bs);
                    tightMarshalString2(new UTF8Buffer(element.getMethodName()), dataOut, bs);
                    tightMarshalString2(new UTF8Buffer(element.getFileName()), dataOut, bs);
                    dataOut.writeInt(element.getLineNumber());
                }
                tightMarshalThrowable2(wireFormat, o.getCause(), dataOut, bs);
            }
        }
View Full Code Here

    }

    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++) {
View Full Code Here

    protected void looseMarshalThrowable(OpenWireFormat wireFormat, Throwable o, DataByteArrayOutputStream dataOut)
        throws IOException {
        dataOut.writeBoolean(o != null);
        if (o != null) {
            looseMarshalString(new UTF8Buffer(o.getClass().getName()), dataOut);
            looseMarshalString(new UTF8Buffer(o.getMessage()), dataOut);
            if (wireFormat.isStackTraceEnabled()) {
                StackTraceElement[] stackTrace = o.getStackTrace();
                dataOut.writeShort(stackTrace.length);
                for (int i = 0; i < stackTrace.length; i++) {
                    StackTraceElement element = stackTrace[i];
                    looseMarshalString(new UTF8Buffer(element.getClassName()), dataOut);
                    looseMarshalString(new UTF8Buffer(element.getMethodName()), dataOut);
                    looseMarshalString(new UTF8Buffer(element.getFileName()), dataOut);
                    dataOut.writeInt(element.getLineNumber());
                }
                looseMarshalThrowable(wireFormat, o.getCause(), dataOut);
            }
        }
View Full Code Here

        } else {
            qoS = message.isPersistent() ? QoS.AT_MOST_ONCE : QoS.AT_LEAST_ONCE;
        }
        result.qos(qoS);

        UTF8Buffer topicName;
        synchronized (mqttTopicMap) {
            topicName = mqttTopicMap.get(message.getJMSDestination());
            if (topicName == null) {
                topicName = new UTF8Buffer(message.getDestination().getPhysicalName().replace('.', '/'));
                mqttTopicMap.put(message.getJMSDestination(), topicName);
            }
        }
        result.topicName(topicName);
View Full Code Here

    }

    protected Throwable tightUnmarsalThrowable(OpenWireFormat wireFormat, DataByteArrayInputStream dataIn, BooleanStream bs)
        throws IOException {
        if (bs.readBoolean()) {
            UTF8Buffer clazz = tightUnmarshalString(dataIn, bs);
            UTF8Buffer message = tightUnmarshalString(dataIn, bs);
            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++) {
View Full Code Here

            bs.writeBoolean(false);
            return 0;
        } else {
            int rc = 0;
            bs.writeBoolean(true);
            rc += tightMarshalString1(new UTF8Buffer(o.getClass().getName()), bs);
            rc += tightMarshalString1(new UTF8Buffer(o.getMessage()), bs);
            if (wireFormat.isStackTraceEnabled()) {
                rc += 2;
                StackTraceElement[] stackTrace = o.getStackTrace();
                for (int i = 0; i < stackTrace.length; i++) {
                    StackTraceElement element = stackTrace[i];
                    rc += tightMarshalString1(new UTF8Buffer(element.getClassName()), bs);
                    rc += tightMarshalString1(new UTF8Buffer(element.getMethodName()), bs);
                    rc += tightMarshalString1(new UTF8Buffer(element.getFileName()), bs);
                    rc += 4;
                }
                rc += tightMarshalThrowable1(wireFormat, o.getCause(), bs);
            }
            return rc;
View Full Code Here

TOP

Related Classes of org.fusesource.hawtbuf.UTF8Buffer

Copyright © 2018 www.massapicom. 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.