Package com.arjuna.ats.internal.txoj.abstractrecords

Examples of com.arjuna.ats.internal.txoj.abstractrecords.LockRecord


                            + sleepTime + ")");
        }

        int conflict = ConflictType.CONFLICT;
        int returnStatus = LockResult.REFUSED;
        LockRecord newLockR = null;
        boolean modifyRequired = false;
        BasicAction currAct = null;

        if (toSet == null)
        {
            if (txojLogger.aitLoggerI18N.isWarnEnabled())
            {
                txojLogger.aitLoggerI18N
                        .warn("com.arjuna.ats.txoj.LockManager_2");
            }

            return LockResult.REFUSED;
        }

        currAct = BasicAction.Current();

        if (currAct != null)
        {
            ActionHierarchy ah = currAct.getHierarchy();

            if (ah != null)
                toSet.changeHierarchy(ah);
            else
            {
                if (txojLogger.aitLoggerI18N.isWarnEnabled())
                {
                    txojLogger.aitLoggerI18N
                            .warn("com.arjuna.ats.txoj.LockManager_3");
                }

                toSet = null;

                return LockResult.REFUSED;
            }
        }

        if (super.loadObjectState())
            super.setupStore();

        while ((conflict == ConflictType.CONFLICT)
                && ((retry >= 0) || (retry == LockManager.waitTotalTimeout)))
        {
            Object syncObject = ((currAct == null) ? getMutex() : currAct);
           
            synchronized (syncObject)
            {
                synchronized (locksHeldLockObject)
                {
                    conflict = ConflictType.CONFLICT;
   
                    if (loadState())
                    {
                        conflict = lockConflict(toSet);
                    }
                    else
                    {
                        if (txojLogger.aitLoggerI18N.isWarnEnabled())
                        {
                            txojLogger.aitLoggerI18N
                                    .warn("com.arjuna.ats.txoj.LockManager_4");
                        }
                    }
   
                    if (conflict != ConflictType.CONFLICT)
                    {
                        /*
                         * When here the conflict was resolved or the retry limit
                         * expired.
                         */
   
                        /* no conflict so set lock */
   
                        modifyRequired = toSet.modifiesObject();
   
                        /* trigger object load from store */
   
                        if (super.activate())
                        {
                            returnStatus = LockResult.GRANTED;
   
                            if (conflict == ConflictType.COMPATIBLE)
                            {
                                int lrStatus = AddOutcome.AR_ADDED;
   
                                if (currAct != null)
                                {
                                    /* add new lock record to action list */
   
                                    newLockR = new LockRecord(this,
                                            (modifyRequired ? false : true),
                                            currAct);
   
                                    if ((lrStatus = currAct.add(newLockR)) != AddOutcome.AR_ADDED)
                                    {
View Full Code Here

TOP

Related Classes of com.arjuna.ats.internal.txoj.abstractrecords.LockRecord

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.