Package org.hornetq.api.core

Examples of org.hornetq.api.core.HornetQBuffer


    * @param xid
    * @return
    */
   private Object convert(Xid xid)
   {
      HornetQBuffer buffer = HornetQBuffers.dynamicBuffer(200);
      XidCodecSupport.encodeXid(xid, buffer);

      Object obj = XidCodecSupport.decodeXid(buffer);

      return "xid=" + obj + ",clientXID=" + xid;
View Full Code Here


                  {
                     HornetQClientLogger.LOGGER.errorReceivingPAcketInDiscovery(e);
                  }
               }

               HornetQBuffer buffer = HornetQBuffers.wrappedBuffer(data);

               String originatingNodeID = buffer.readString();

               String uniqueID = buffer.readString();

               checkUniqueID(originatingNodeID, uniqueID);

               if (nodeID.equals(originatingNodeID))
               {
                  if (checkExpiration())
                  {
                     callListeners();
                  }
                  // Ignore traffic from own node
                  continue;
               }

               int size = buffer.readInt();

               boolean changed = false;

               DiscoveryEntry[] entriesRead = new DiscoveryEntry[size];
               // Will first decode all the elements outside of any lock
View Full Code Here

         if (connections.putIfAbsent(connection.getID(), connection) != null)
         {
            throw HornetQClientMessageBundle.BUNDLE.connectionExists(connection.getID());
         }
         String handshake = "HORNETQ";
         HornetQBuffer buffer = connection.createBuffer(handshake.length());
         buffer.writeBytes(handshake.getBytes());
         connection.write(buffer);
      }
View Full Code Here

   public synchronized HornetQBuffer getBodyBufferCopy()
   {
      // Must copy buffer before sending it

      HornetQBuffer newBuffer = buffer.copy(0, buffer.capacity());

      newBuffer.setIndex(0, getEndOfBodyPosition());

      return new ResetLimitWrappedHornetQBuffer(BODY_OFFSET, newBuffer, null);
   }
View Full Code Here

      buff.readerIndex(start + length);
   }

   public synchronized HornetQBuffer getEncodedBuffer()
   {
      HornetQBuffer buff = encodeToBuffer();

      if (bufferUsed)
      {
         HornetQBuffer copied = buff.copy(0, buff.capacity());

         copied.setIndex(0, endOfMessagePosition);

         return copied;
      }
      else
      {
View Full Code Here

         return buffer.writerIndex();
      }

      public int encode(final ByteBuffer bufferRead) throws HornetQException
      {
         HornetQBuffer buffer = HornetQBuffers.wrappedBuffer(bufferRead);
         return encode(buffer, bufferRead.capacity());
      }
View Full Code Here

         {
            final boolean lastChunk;

            final int chunkLength = Math.min((int) (bodySize - pos), minLargeMessageSize);

            final HornetQBuffer bodyBuffer = HornetQBuffers.fixedBuffer(chunkLength);

            context.encode(bodyBuffer, chunkLength);

            pos += chunkLength;

            lastChunk = pos >= bodySize;
            final boolean requiresResponse = lastChunk && sendBlocking;
            SendAcknowledgementHandler messageHandler = lastChunk ? handler : null;
            final SessionSendContinuationMessage chunk =
               new SessionSendContinuationMessage(msgI, bodyBuffer.toByteBuffer().array(), !lastChunk,
                                                  requiresResponse, messageHandler);

            if (requiresResponse)
            {
               // When sending it blocking, only the last chunk will be blocking.
View Full Code Here

      currentLargeMessageController = new LargeMessageControllerImpl(this, largeMessage.getLargeMessageSize(), callTimeout, largeMessageCache);
      currentLargeMessageController.setLocal(true);

      //sets the packet
      HornetQBuffer qbuff = clMessage.getBodyBuffer();
      int bytesToRead = qbuff.writerIndex() - qbuff.readerIndex();
      final byte[] body = qbuff.readBytes(bytesToRead).toByteBuffer().array();

      largeMessage.setLargeMessageController(new CompressedLargeMessageControllerImpl(currentLargeMessageController));
      SessionReceiveContinuationMessage packet = new SessionReceiveContinuationMessage(this.getID(), body, false, false, body.length);
      currentLargeMessageController.addPacket(packet);
View Full Code Here

         }

         RecordInfo record = records.get(reccount);
         byte[] data = record.data;

         HornetQBuffer buff = HornetQBuffers.wrappedBuffer(data);

         byte recordType = record.getUserRecordType();

         switch (recordType)
         {
View Full Code Here

      for (RecordInfo record : records)
      {
         long id = record.id;

         HornetQBuffer buffer = HornetQBuffers.wrappedBuffer(record.data);

         byte rec = record.getUserRecordType();

         if (rec == JournalStorageManager.QUEUE_BINDING_RECORD)
         {
View Full Code Here

TOP

Related Classes of org.hornetq.api.core.HornetQBuffer

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.