Package net.timewalker.ffmq3.utils

Examples of net.timewalker.ffmq3.utils.RawDataBuffer.clear()


    set.add(3,"msg3",1,null);
    set.add(4,"msg4",1,null);
   
    assertEquals(4,set.size());
   
    TransactionItem[] items = set.clear();
    assertEquals(4,items.length);
    for(int n=0;n<items.length;n++)
      assertEquals(n+1,items[n].getHandle());
   
    assertEquals(0,set.size());
View Full Code Here


    for (int i = 1; i <= 100; i++)
      set.add(i,"msg"+i,1,null);
   
    assertEquals(100,set.size());
   
    TransactionItem[] items = set.clear();
    assertEquals(100,items.length);
    for(int n=0;n<items.length;n++)
      assertEquals(n+1,items[n].getHandle());
   
    assertEquals(0,set.size());
View Full Code Here

    set.add(3,"msg3",1,null);
    set.add(4,"msg4",1,null);
   
    assertEquals(4,set.size());
   
    TransactionItem[] items = set.clear();
    assertEquals(4,items.length);
    for(int n=0;n<items.length;n++)
      assertEquals(n+1,items[n].getHandle());
   
    assertEquals(0,set.size());
View Full Code Here

    set.add(2,"msg2",1,null);
    set.add(3,"msg3",1,null);
   
    assertEquals(3,set.size());
   
    items = set.clear();
    assertEquals(3,items.length);
    for(int n=0;n<items.length;n++)
      assertEquals(n+1,items[n].getHandle());
   
    assertEquals(0,set.size());
View Full Code Here

   
      assertEquals(msgCount,set.size());
   
      deliveredMessageIDs.clear();
      deliveredMessageIDs.add("msg"+n);
      TransactionItem[] items = set.clear(deliveredMessageIDs);
 
      assertEquals(msgCount-1,set.size());
      assertEquals(1, items.length);
      assertEquals(n, items[0].getHandle());
     
View Full Code Here

 
      assertEquals(msgCount-1,set.size());
      assertEquals(1, items.length);
      assertEquals(n, items[0].getHandle());
     
      set.clear();
    }
  }
}
View Full Code Here

    }
   
    public AbstractPacket receive( int maxPacketSize ) throws PacketTransportException
    {
        RawDataBuffer buffer = inChannel.ioBuffer;
        buffer.clear();
       
        // Receive data
        int responseSize = receiveSize(inChannel.stream);
        if (responseSize == -1)
            return null;
View Full Code Here

                  AbstractPacket packet = (AbstractPacket)pipeline.removeFirst();
                 
                  // We need to serialize the packet in a side buffer in order to
                  // know its final size before writing it to the actual output stream
                      RawDataBuffer buffer = outChannel.ioBuffer;
                      buffer.clear();
                      PacketSerializer.serializeTo(packet, buffer);
                     
                      // Write it on the stream
                      OutputStream out = outChannel.socketOutputStream;
                      SerializationTools.writeInt(buffer.size(),out); // Packet size
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.