Package org.jboss.cache

Examples of org.jboss.cache.GlobalTransaction


     * @return
     * @throws Throwable
     */
    private Object handleCommitRollback(MethodCall m) throws Throwable
    {
        GlobalTransaction gtx = findGlobalTransaction( m.getArgs() );
        Object result;

        // this must have a local transaction associated if a prepare has been
        // callled before
        //Transaction ltx = getLocalTxForGlobalTx(gtx);
View Full Code Here


     * @return
     * @throws Exception
     */
    private GlobalTransaction registerTransaction(Transaction tx) throws Exception
    {
        GlobalTransaction gtx;
        if (isValid(tx) && transactions.put(tx, NULL) == null)
        {
            gtx = cache.getCurrentTransaction(tx);
            if (gtx.isRemote())
            {
                // should be no need to register a handler since this a remotely initiated gtx
                if (log.isTraceEnabled()) {log.trace("is a remotely initiated gtx so no need to register a tx for it");}
            }
            else
View Full Code Here

    public Object invoke(MethodCall call) throws Throwable
    {
        JBCMethodCall m = (JBCMethodCall) call;
        InvocationContext ctx = getInvocationContext();
        Transaction tx = ctx.getTransaction();
        GlobalTransaction gtx = ctx.getGlobalTransaction();
        Object retval = null;
      
       // bypass for buddy group org metod calls.
       if (isBuddyGroupOrganisationMethod(m)) return super.invoke(m);
View Full Code Here

   }

   public void testKnownTypeMagicNumbers() throws Exception
   {
      doMagicNumberTest(new Fqn(), TreeCacheMarshaller140.MAGICNUMBER_FQN);
      doMagicNumberTest(new GlobalTransaction(), TreeCacheMarshaller140.MAGICNUMBER_GTX);
      doMagicNumberTest(new IpAddress(), TreeCacheMarshaller140.MAGICNUMBER_IPADDRESS);
      doMagicNumberTest(new Integer(10), TreeCacheMarshaller140.MAGICNUMBER_INTEGER);
      doMagicNumberTest(new Long(10), TreeCacheMarshaller140.MAGICNUMBER_LONG);
      doMagicNumberTest(Boolean.TRUE, TreeCacheMarshaller140.MAGICNUMBER_BOOLEAN);
      doMagicNumberTest("HELLO", TreeCacheMarshaller140.MAGICNUMBER_STRING);
View Full Code Here

      if (isBuddyGroupOrganisationMethod(m)) return super.invoke(m);


      Object result = null;

      GlobalTransaction gtx = ctx.getGlobalTransaction();

      TransactionWorkspace workspace = getTransactionWorkspace(gtx);

      if (MethodDeclarations.isCrudMethod(meth))
      {
View Full Code Here

      Map nodeData = null;
      boolean initNode = false; // keep uninitialized
      Object key = null;
      InvocationContext ctx = getInvocationContext();
      TransactionEntry entry = null;
      GlobalTransaction gtx = null;
      if ((gtx = ctx.getGlobalTransaction()) != null)
      {
         entry = txTable.get(gtx);
      }
View Full Code Here

    * transaction.
    * This is O(N) WRT to the number of modifications so far.
    */
   private boolean wasRemovedInTx(Fqn fqn)
   {
      GlobalTransaction t = getInvocationContext().getGlobalTransaction();
      if (t == null)
         return false;
      TransactionEntry entry = txTable.get(t);
      Iterator i = entry.getCacheLoaderModifications().iterator();
      while (i.hasNext())
View Full Code Here

           // the tx has had a synchronization registered. Not really ideal...
           if (transactions.get(ctx.getTransaction()) == null)
           {
              // make sure we remove the tx and global tx from the transaction table, since we don't care about this transaction
              // and will just suspend it.  - JBCACHE-1246
              GlobalTransaction gtx = txTable.remove(ctx.getTransaction());
              if (gtx != null) txTable.remove(gtx);
           }
          
           suspendedTransaction = txManager.suspend();
           // set the tx in the invocation context to null now! - JBCACHE-785
View Full Code Here

    private MethodCall attachGlobalTransaction(Transaction tx, MethodCall m) throws Exception
    {
        if (log.isDebugEnabled()) log.debug(" local transaction exists - registering global tx if not present for " + Thread.currentThread());
        if (log.isTraceEnabled())
        {
            GlobalTransaction tempGtx = txTable.get(tx);
            log.trace("Associated gtx in txTable is " + tempGtx);
        }

        // register a sync handler for this tx - only if the gtx is not remotely initiated.
        GlobalTransaction gtx = registerTransaction(tx);
        if (gtx != null)
        {
            m = replaceGtx(m, gtx);
        }
        else
View Full Code Here

     * @return
     * @throws Throwable
     */
    private Object handleCommitRollback(MethodCall m) throws Throwable
    {
        GlobalTransaction gtx = findGlobalTransaction( m.getArgs() );
        Object result;

        // this must have a local transaction associated if a prepare has been
        // callled before
        //Transaction ltx = getLocalTxForGlobalTx(gtx);
View Full Code Here

TOP

Related Classes of org.jboss.cache.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.