Package org.hornetq.core.journal

Examples of org.hornetq.core.journal.IOAsyncTask


   }

   public void close(final boolean failed)
   {
      if (closed) return;
      context.executeOnCompletion(new IOAsyncTask()
      {
         public void onError(int errorCode, String errorMessage)
         {
         }
         public void done()
View Full Code Here


     
      try
      {
         storageManager.setContext(sessionContext);

         storageManager.afterCompleteOperations(new IOAsyncTask()
         {
            public void onError(int errorCode, String errorMessage)
            {
            }
  
View Full Code Here

      if (persistent)
      {
         store.storeCursorAcknowledge(cursorId, position);
      }

      store.afterCompleteOperations(new IOAsyncTask()
      {
         volatile String error = "";

         @Override
         public void onError(final int errorCode, final String errorMessage)
View Full Code Here

      });
   }

   private void sendReply(final StompConnection connection, final StompFrame frame)
   {
      server.getStorageManager().afterCompleteOperations(new IOAsyncTask()
      {
         public void onError(final int errorCode, final String errorMessage)
         {
            log.warn("Error processing IOCallback code = " + errorCode + " message = " + errorMessage);
View Full Code Here

      try
      {
         storageManager.setContext(sessionContext);

         storageManager.afterCompleteOperations(new IOAsyncTask()
         {
            public void onError(int errorCode, String errorMessage)
            {
            }
View Full Code Here

         {
            replicatedJournal.appendAddRecord(i, (byte)1, new FakeData(), false);
         }

         final CountDownLatch latch = new CountDownLatch(1);
         storage.afterCompleteOperations(new IOAsyncTask()
         {

            public void onError(final int errorCode, final String errorMessage)
            {
            }
View Full Code Here

      final List<String> msgsResult = new ArrayList<String>();

      final CountDownLatch latch = new CountDownLatch(1);

      ctx.executeOnCompletion(new IOAsyncTask()
      {
         public void onError(final int errorCode, final String errorMessage)
         {
            lastError.set(errorCode);
            msgsResult.add(errorMessage);
            latch.countDown();
         }

         public void done()
         {
         }
      });

      Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));

      Assert.assertEquals(5, lastError.get());

      Assert.assertEquals(1, msgsResult.size());

      Assert.assertEquals(msg, msgsResult.get(0));

      final CountDownLatch latch2 = new CountDownLatch(1);

      // Adding the Task after the exception should still throw an exception
      ctx.executeOnCompletion(new IOAsyncTask()
      {
         public void onError(final int errorCode, final String errorMessage)
         {
            lastError.set(errorCode);
            msgsResult.add(errorMessage);
            latch2.countDown();
         }

         public void done()
         {
         }
      });

      Assert.assertTrue(latch2.await(5, TimeUnit.SECONDS));

      Assert.assertEquals(2, msgsResult.size());

      Assert.assertEquals(msg, msgsResult.get(0));

      Assert.assertEquals(msg, msgsResult.get(1));

      final CountDownLatch latch3 = new CountDownLatch(1);

      ctx.executeOnCompletion(new IOAsyncTask()
      {
         public void onError(final int errorCode, final String errorMessage)
         {
         }
View Full Code Here

    * @return
    */
   private void blockOnReplication(final StorageManager storage, final ReplicationManagerImpl manager) throws Exception
   {
      final CountDownLatch latch = new CountDownLatch(1);
      storage.afterCompleteOperations(new IOAsyncTask()
      {

         public void onError(final int errorCode, final String errorMessage)
         {
         }
View Full Code Here

         Journal replicatedJournal = new ReplicatedJournal((byte)1, new FakeJournal(), manager);

         replicatedJournal.appendPrepareRecord(1, new FakeData(), false);

         final CountDownLatch latch = new CountDownLatch(1);
         storage.afterCompleteOperations(new IOAsyncTask()
         {

            public void onError(final int errorCode, final String errorMessage)
            {
            }
View Full Code Here

            if (i % 2 == 0)
            {
               replicatedJournal.appendPrepareRecord(i, new FakeData(), false);
            }

            ctx.executeOnCompletion(new IOAsyncTask()
            {

               public void onError(final int errorCode, final String errorMessage)
               {
               }
View Full Code Here

TOP

Related Classes of org.hornetq.core.journal.IOAsyncTask

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.