Examples of LargeMessageControllerImpl


Examples of org.hornetq.core.client.impl.LargeMessageControllerImpl

   }


   public void testStreamDataWaitCompletionOnSlowComingBuffer() throws Exception
   {
      final LargeMessageControllerImpl outBuffer = new LargeMessageControllerImpl(new FakeConsumerInternal(), 5, 1000);


      class FakeOutputStream extends OutputStream
      {
         @Override
         public void write(int b) throws IOException
         {
         }
      }

      outBuffer.setOutputStream(new FakeOutputStream());

      Thread sender = new Thread()
      {
         public void run()
         {
            try
            {
               Thread.sleep(200);
               outBuffer.addPacket(new FakePacket(-1, new byte[] { 0 }, true, false));
               Thread.sleep(1000);
               outBuffer.addPacket(new FakePacket(-1, new byte[] { 0 }, true, false));
               Thread.sleep(1000);
               outBuffer.addPacket(new FakePacket(-1, new byte[] { 0 }, false, false));
            }
            catch (Exception e)
            {
            }
         }
      };

      sender.start();
      outBuffer.waitCompletion(0);
      sender.join();
   }
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.