Package org.infinispan.transaction.xa

Examples of org.infinispan.transaction.xa.TransactionXaAdapter


            localContext = new LocalTxInvocationContext();
            icTl.set(localContext);
         } else {
            localContext = (LocalTxInvocationContext) existing;
         }
         TransactionXaAdapter xaAdapter = transactionTable.getXaCacheAdapter(tx);
         localContext.setXaCache(xaAdapter);
         return localContext;
      } else {
         NonTxInvocationContext nonTxContext;
         if ((existing == null) || !(existing instanceof NonTxInvocationContext)) {
View Full Code Here


      return enlistReadAndInvokeNext(ctx, command);
   }

   private Object enlistReadAndInvokeNext(InvocationContext ctx, VisitableCommand command) throws Throwable {
      if (shouldEnlist(ctx)) {
         TransactionXaAdapter xaAdapter = enlist(ctx);
         LocalTxInvocationContext localTxContext = (LocalTxInvocationContext) ctx;
         localTxContext.setXaCache(xaAdapter);
      }
      return invokeNextInterceptor(ctx, command);
   }
View Full Code Here

      }
      return invokeNextInterceptor(ctx, command);
   }

   private Object enlistWriteAndInvokeNext(InvocationContext ctx, WriteCommand command) throws Throwable {
      TransactionXaAdapter xaAdapter = null;
      boolean shouldAddMod = false;
      if (shouldEnlist(ctx)) {
         xaAdapter = enlist(ctx);
         LocalTxInvocationContext localTxContext = (LocalTxInvocationContext) ctx;
         if (!isLocalModeForced(ctx)) {
            shouldAddMod = true;
         }
         localTxContext.setXaCache(xaAdapter);
      }
      if (!ctx.isInTxScope())
         transactionLog.logNoTxWrite(command);
      Object rv = invokeNextInterceptor(ctx, command);
      if (command.isSuccessful() && shouldAddMod) xaAdapter.addModification(command);
      return rv;
   }
View Full Code Here

      return new StatsImpl(invoker);
   }

   @Override
   public XAResource getXAResource() {
      return new TransactionXaAdapter(txTable, recoveryManager, txCoordinator, commandsFactory, rpcManager, null, config, name);
   }
View Full Code Here

      txTable.addLocalTransactionMapping(localTx);     

      configuration = new ConfigurationBuilder().build();
      txCoordinator = new TransactionCoordinator();
      txCoordinator.init(null, null, null, null, configuration);
      xaAdapter = new TransactionXaAdapter(localTx, txTable, null, txCoordinator, null, null,
                                           new ClusteringDependentLogic.InvalidationLogic(), configuration, "");
   }
View Full Code Here

      return new StatsImpl(invoker);
   }

   @Override
   public XAResource getXAResource() {
      return new TransactionXaAdapter(null, txTable, config, recoveryManager, txCoordinator);
   }
View Full Code Here

      if (isNotValid(status)) throw new IllegalStateException("Transaction " + transaction +
            " is not in a valid state to be invoking cache operations on.");
      LocalTransaction localTransaction = txTable.getOrCreateLocalTransaction(transaction, ctx);
      if (!localTransaction.isEnlisted()) { //make sure that you only enlist it once
         try {
            transaction.enlistResource(new TransactionXaAdapter(localTransaction, txTable, commandsFactory, configuration, invoker, icc));
         } catch (Exception e) {
            log.error("Failed to enlist TransactionXaAdapter to transaction");
            throw new CacheException(e);
         }
      }
View Full Code Here

      return enlistReadAndInvokeNext(ctx, command);
   }

   private Object enlistReadAndInvokeNext(InvocationContext ctx, VisitableCommand command) throws Throwable {
      if (shouldEnlist(ctx)) {
         TransactionXaAdapter xaAdapter = enlist(ctx);
         LocalTxInvocationContext localTxContext = (LocalTxInvocationContext) ctx;
         localTxContext.setXaCache(xaAdapter);
      }
      return invokeNextInterceptor(ctx, command);
   }
View Full Code Here

      }
      return invokeNextInterceptor(ctx, command);
   }

   private Object enlistWriteAndInvokeNext(InvocationContext ctx, WriteCommand command) throws Throwable {
      TransactionXaAdapter xaAdapter = null;
      boolean shouldAddMod = false;
      if (shouldEnlist(ctx)) {
         xaAdapter = enlist(ctx);
         LocalTxInvocationContext localTxContext = (LocalTxInvocationContext) ctx;
         if (!isLocalModeForced(ctx)) {
            shouldAddMod = true;
         }
         localTxContext.setXaCache(xaAdapter);
      }
      Object rv = invokeNextInterceptor(ctx, command);
      if (!ctx.isInTxScope())
         transactionLog.logNoTxWrite(command);
      if (command.isSuccessful() && shouldAddMod) xaAdapter.addModification(command);
      return rv;
   }
View Full Code Here

            localContext = new LocalTxInvocationContext();
            icTl.set(localContext);
         } else {
            localContext = (LocalTxInvocationContext) existing;
         }
         TransactionXaAdapter xaAdapter = transactionTable.getXaCacheAdapter(tx);
         localContext.setXaCache(xaAdapter);
         return localContext;
      } else {
         NonTxInvocationContext nonTxContext;
         if ((existing == null) || !(existing instanceof NonTxInvocationContext)) {
View Full Code Here

TOP

Related Classes of org.infinispan.transaction.xa.TransactionXaAdapter

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.