Examples of OrderedSynchronizationHandler


Examples of org.jboss.cache.interceptors.OrderedSynchronizationHandler

      mgr.begin();

      cache0.put("/test", "x", "y");

      GlobalTransaction gtx = cache0.getTransactionTable().get(mgr.getTransaction());
      OrderedSynchronizationHandler orderedHandler = cache0.getTransactionTable().get(gtx).getOrderedSynchronizationHandler();
//      OrderedSynchronizationHandler orderedHandler = OrderedSynchronizationHandler.getInstance(mgr.getTransaction());
      orderedHandler.registerAtTail(new DummySynchronization(cache0, mgr));

      try
      {
         mgr.commit();
      }
View Full Code Here

Examples of org.jboss.cache.interceptors.OrderedSynchronizationHandler

         this.abortBeforeCompletion = abortBeforeCompletion;
      }

      public void notify(Transaction tx, TransactionEntry entry) throws SystemException, RollbackException
      {
         OrderedSynchronizationHandler osh = entry.getOrderedSynchronizationHandler();

         final Transaction finalTx = tx;
         System.out.println("Notify called.");
         // add an aborting sync handler.
         Synchronization abort = new Synchronization()
         {

            public void beforeCompletion()
            {
               if (abortBeforeCompletion)
               {
                  cache3.getConfiguration().getRuntimeConfig().getChannel().close();
                  System.out.println("Returning from abort.beforeCompletion");
                  try
                  {
                     finalTx.setRollbackOnly();
                  }
                  catch (SystemException e)
                  {
                     throw new RuntimeException("Unable to set rollback", e);
                  }
                  throw new RuntimeException("Dummy exception");
               }
            }

            public void afterCompletion(int i)
            {
               if (!abortBeforeCompletion)
               {
                  cache3.getConfiguration().getRuntimeConfig().getChannel().close();
                  System.out.println("Returning from abort.afterCompletion");
                  throw new RuntimeException("Dummy exception");
               }
            }
         };

         osh.registerAtHead(abort);
         System.out.println("Added sync handler.");
      }
View Full Code Here

Examples of org.jboss.cache.interceptors.OrderedSynchronizationHandler

      cache.put(FQN, "key", "value");
      cache.put(FQN, "key2", "value2");

      GlobalTransaction gtx = cache.getTransactionTable().get(cache.getTransactionManager().getTransaction());
      OrderedSynchronizationHandler osh = cache.getTransactionTable().get(gtx).getOrderedSynchronizationHandler();

//      OrderedSynchronizationHandler.getInstance(cache.getTransactionManager().getTransaction()).registerAtTail(
      osh.registerAtTail(
            new Synchronization()
            {

               public void beforeCompletion()
               {
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.