Examples of OrderedSynchronizationHandler


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

Examples of org.jboss.cache.interceptors.OrderedSynchronizationHandler

   private List<Fqn> removedNodes = null;

   public AbstractTransactionContext(Transaction tx) throws SystemException, RollbackException
   {
      ltx = tx;
      orderedSynchronizationHandler = new OrderedSynchronizationHandler(tx);
   }
View Full Code Here

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, TransactionContext transactionContext) throws SystemException, RollbackException
      {
         OrderedSynchronizationHandler osh = transactionContext.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

      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, TransactionContext transactionContext) throws SystemException, RollbackException
      {
         OrderedSynchronizationHandler osh = transactionContext.getOrderedSynchronizationHandler();

         final Transaction finalTx = tx;
         // add an aborting sync handler.
         Synchronization abort = new Synchronization()
         {

            public void beforeCompletion()
            {
               if (abortBeforeCompletion)
               {
                  cache3.getConfiguration().getRuntimeConfig().getChannel().close();
                  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();
                  throw new RuntimeException("Dummy exception");
               }
            }
         };

         osh.registerAtHead(abort);
      }
View Full Code Here

Examples of org.jboss.cache.interceptors.OrderedSynchronizationHandler

   private final List<Fqn> removedNodes = new LinkedList<Fqn>();

   public TransactionEntry(Transaction tx) throws SystemException, RollbackException
   {
      ltx = tx;
      orderedSynchronizationHandler = new OrderedSynchronizationHandler(tx);
   }
View Full Code Here

Examples of org.jboss.cache.interceptors.OrderedSynchronizationHandler

        TransactionManager mgr = caches[0].getTransactionManager();

        mgr.begin();

        OrderedSynchronizationHandler orderedHandler = OrderedSynchronizationHandler.getInstance(mgr.getTransaction());
        orderedHandler.registerAtTail(new DummySynchronization(caches[0], mgr));

        caches[0].put("/test", "x", "y");
        try
        {
            mgr.commit();
View Full Code Here

Examples of org.jboss.cache.interceptors.OrderedSynchronizationHandler

                            throw new RuntimeException("Dummy exception");
                        }
                    }
                };

                OrderedSynchronizationHandler osh = OrderedSynchronizationHandler.getInstance(tx);
                osh.registerAtHead(abort);
                System.out.println("Added sync handler.");
            }
        };

        mgr1.begin();
View Full Code Here

Examples of org.jboss.cache.interceptors.OrderedSynchronizationHandler

   private List<Fqn> removedNodes = new LinkedList<Fqn>();

   public TransactionEntry(Transaction tx) throws SystemException, RollbackException
   {
      ltx = tx;
      orderedSynchronizationHandler = new OrderedSynchronizationHandler(tx);
   }
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.