Package org.jboss.cache.transaction

Examples of org.jboss.cache.transaction.GlobalTransaction


   @SuppressWarnings("unchecked")
   public V put(Fqn fqn, K key, V value)
   {
      InvocationContext ctx = invocationContextContainer.get();
      cacheStatusCheck(ctx);
      GlobalTransaction tx = transactionTable.getCurrentTransaction();
      PutKeyValueCommand command = commandsFactory.buildPutKeyValueCommand(tx, fqn, key, value);
      return (V) invoker.invoke(ctx, command);
   }
View Full Code Here


    */
   public void clearData(Fqn fqn)
   {
      InvocationContext ctx = invocationContextContainer.get();
      cacheStatusCheck(ctx);
      GlobalTransaction tx = getCurrentTransaction();
      invoker.invoke(ctx, commandsFactory.buildClearDataCommand(tx, fqn));
   }
View Full Code Here

      return commandsFactory.fromStream(methodId, args);
   }

   private GlobalTransaction unmarshallGlobalTransaction(ObjectInputStream in, UnmarshalledReferences refMap) throws Exception
   {
      GlobalTransaction gtx = new GlobalTransaction();
      long id = in.readLong();
      Object address = unmarshallObject(in, refMap);
      gtx.setId(id);
      gtx.setAddress((Address) address);
      return gtx;
   }
View Full Code Here

   @Override
   public NodeSPI<K, V> addChildDirect(Fqn f, boolean notify)
   {
      if (f.size() == 1)
      {
         GlobalTransaction gtx = cache.getInvocationContext().getGlobalTransaction();
         return getOrCreateChild(f.getLastElement(), gtx, true, notify);
      }
      else
      {
         throw new UnsupportedOperationException("Cannot directly create children which aren't directly under the current node.");
View Full Code Here

   }

   @Override
   public NodeSPI<K, V> addChildDirect(Object o, boolean notify)
   {
      GlobalTransaction gtx = cache.getInvocationContext().getGlobalTransaction();
      return getOrCreateChild(o, gtx, true, notify);
   }
View Full Code Here

      // if we do not have the node then we need to add it to the workspace
      if (workspaceNode == null)
      {
         NodeSPI node = dataContainer.peek(fqn, true, includeInvalidNodes);
         if (node == null) return null;
         GlobalTransaction gtx = ctx.getGlobalTransaction();
         workspaceNode = lockAndCreateWorkspaceNode(nodeFactory, node, workspace, gtx, lockAcquisitionTimeout);

         // and add the node to the workspace.
         workspace.addNode(workspaceNode);
      }
View Full Code Here

   }

   @SuppressWarnings("unchecked")
   private void commitTransaction(InvocationContext ctx)
   {
      GlobalTransaction gtx = getGlobalTransaction(ctx);
      TransactionWorkspace workspace;
      workspace = getTransactionWorkspace(ctx);

      if (log.isDebugEnabled()) log.debug("Commiting successfully validated changes for GlobalTransaction " + gtx);
      Collection<WorkspaceNode> workspaceNodes = workspace.getNodes().values();
View Full Code Here

   @Override
   public Object visitOptimisticPrepareCommand(InvocationContext ctx, OptimisticPrepareCommand command) throws Throwable
   {
      //try and acquire the locks - before passing on
      GlobalTransaction gtx = getGlobalTransaction(ctx);

      boolean succeeded = false;
      try
      {
         TransactionWorkspace<?, ?> workspace = getTransactionWorkspace(ctx);
View Full Code Here

      Transaction tx = ctx.getTransaction();
      if (tx != null)
      {
         if (trace) log.trace("Entering InvalidationInterceptor's prepare phase");
         // fetch the modifications before the transaction is committed (and thus removed from the txTable)
         GlobalTransaction gtx = ctx.getGlobalTransaction();
         TransactionContext transactionContext = ctx.getTransactionContext();
         if (transactionContext == null)
            throw new IllegalStateException("cannot find transaction transactionContext for " + gtx);

         if (transactionContext.hasModifications())
View Full Code Here

      Object retval = invokeNextInterceptor(ctx, command);
      Transaction tx = ctx.getTransaction();
      if (tx != null)
      {
         // here we just record the modifications but actually do the invalidate in commit.
         GlobalTransaction gtx = ctx.getGlobalTransaction();
         TransactionContext transactionContext = ctx.getTransactionContext();
         if (transactionContext == null)
            throw new IllegalStateException("cannot find transaction transactionContext for " + gtx);

         if (transactionContext.hasModifications())
View Full Code Here

TOP

Related Classes of org.jboss.cache.transaction.GlobalTransaction

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.