Package org.hornetq.core.protocol.stomp

Examples of org.hornetq.core.protocol.stomp.Stomp$Headers$Message


          }

          for( ;; )
          {
              ByteBuffer buf = ByteBuffer.allocate( 8192 );
              Message m = ( Message ) message;
              try
              {
                  if( m.write( buf.buf() ) )
                  {
                      break;
                  }
              }
              finally
View Full Code Here


    }

  public void decode(IoSession session, ByteBuffer in, org.apache.mina.filter.codec.ProtocolDecoderOutput out) throws Exception {
         put( in );

          Message m = readingMessage;
          try
          {
              for( ;; )
              {
                  readBuf.flip();
                  if( m == null )
                  {
                      int limit = readBuf.limit();
                      boolean failed = true;
                      try
                      {
                          m = recognizer.recognize( readBuf );
                          failed = false;
                      }
                      finally
                      {
                          if( failed )
                          {
                              // clear the read buffer if failed to recognize
                              readBuf.clear();
                              break;
                          }
                          else
                          {
                              if( m == null )
                              {
                                  readBuf.limit( readBuf.capacity() );
                                  readBuf.position( limit );
                                  break; // finish decoding
                              }
                              else
                              {
                                  // reset buffer for read
                                  readBuf.limit( limit );
                                  readBuf.position( 0 );
                              }
                          }
                      }
                  }

                  if( m != null )
                  {
                      try
                      {
                        //System.err.println("NETTY trying to decode : "+m);
                          if( m.read( readBuf ) )
                          {
                              out.write( m );
                              m = null;
                          } else {
                            break;
View Full Code Here

    public void decode(IoSession session, ByteBuffer in,
            ProtocolDecoderOutput out) throws Exception {
        put(in);

        Message m = readingMessage;
        try {
            for (;;) {
                readBuf.flip();
                if (m == null) {
                    int limit = readBuf.limit();
                    boolean failed = true;
                    try {
                        m = recognizer.recognize(readBuf);
                        failed = false;
                    } finally {
                        if (failed) {
                            // clear the read buffer if failed to recognize
                            readBuf.clear();
                            break;
                        } else {
                            if (m == null) {
                                readBuf.limit(readBuf.capacity());
                                readBuf.position(limit);
                                break; // finish decoding
                            } else {
                                // reset buffer for read
                                readBuf.limit(limit);
                                readBuf.position(0);
                            }
                        }
                    }
                }

                if (m != null) {
                    try {
                        if (m.read(readBuf)) {
                            out.write(m);
                            m = null;
                        } else {
                            break;
                        }
View Full Code Here

                    "This encoder can decode only Netty Messages.");
        }

        for (;;) {
            ByteBuffer buf = ByteBuffer.allocate(8192);
            Message m = (Message) message;
            try {
                if (m.write(buf.buf())) {
                    break;
                }
            } finally {
                buf.flip();
                if (buf.hasRemaining()) {
View Full Code Here

                    "This encoder can decode only Netty Messages.");
        }

        for (;;) {
            IoBuffer buf = IoBuffer.allocate(8192);
            Message m = (Message) message;
            try {
                if (m.write(buf.buf())) {
                    break;
                }
            } finally {
                buf.flip();
                if (buf.hasRemaining()) {
View Full Code Here

    public void decode(IoSession session, IoBuffer in,
            ProtocolDecoderOutput out) throws Exception {
        put(in);

        Message m = readingMessage;
        try {
            for (;;) {
                readBuf.flip();
                if (m == null) {
                    int limit = readBuf.limit();
                    boolean failed = true;
                    try {
                        m = recognizer.recognize(readBuf);
                        failed = false;
                    } finally {
                        if (failed) {
                            // clear the read buffer if failed to recognize
                            readBuf.clear();
                            break;
                        } else {
                            if (m == null) {
                                readBuf.limit(readBuf.capacity());
                                readBuf.position(limit);
                                break; // finish decoding
                            } else {
                                // reset buffer for read
                                readBuf.limit(limit);
                                readBuf.position(0);
                            }
                        }
                    }
                }

                if (m != null) {
                    try {
                        if (m.read(readBuf)) {
                            out.write(m);
                            m = null;
                        } else {
                            break;
                        }
View Full Code Here

          log("map.get(" + key + ") = " + obj);
      if (obj == null) {
        resp.sendError(404, "Not here: " + e);
        return;
      }
      Headers h = new Headers();
      h = h.mergeMetadata(obj.getMetadata());
      for (Map.Entry<String, List<String>> me : h.getHeaders().entrySet()) {
        for (String v : me.getValue()) {
          resp.setHeader(me.getKey(), v);
        }
      }
      resp.getOutputStream().write(obj.getData());
View Full Code Here

          break;
        os.write(b, 0, len);
      }
      S3Object s3 = new S3Object(os.toByteArray());
      map.put(e, s3);
      Headers h = new Headers();
      @SuppressWarnings("unchecked")
      Enumeration<String> names = req.getHeaderNames();
      for (String n : Collections.list(names))
        h.put(n, req.getHeader(n));
      s3.setMetadata(h.extractMetadata());
      log("put '" + e + "' as: " + s3);
    }
  }
View Full Code Here

    public void testMessageUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("message.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 2);
        assertTrue(definitions.getRootElements().iterator().next() instanceof Message);
        Message msg = (Message) definitions.getRootElements().iterator().next();
        assertEquals("message", msg.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.MESSAGE: {
            Message message = (Message) theEObject;
            T result = caseMessage(message);
            if (result == null)
                result = caseRootElement(message);
            if (result == null)
                result = caseBaseElement(message);
View Full Code Here

TOP

Related Classes of org.hornetq.core.protocol.stomp.Stomp$Headers$Message

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.