+ 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)
{