Author: manik.surtani(a)jboss.com
Date: 2008-04-14 14:13:55 -0400 (Mon, 14 Apr 2008)
New Revision: 5561
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
Log:
Updated
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-04-14
17:08:26 UTC (rev 5560)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-04-14
18:13:55 UTC (rev 5561)
@@ -27,6 +27,14 @@
import java.util.LinkedList;
import java.util.List;
+/*
+* todo refactorings ideas
+* - thre are many places in code that handles that coputes the lock owners: either
GTX or Thread.local. The
+* lockOwner can be abstractised as a LockOwner that can be extended by
CurrentThreadLock owner and
+ GlobalTransaction owner. This would make the code nicer.
+*/
+
+
/**
* An interceptor that handles locking. When a TX is associated, we register
* for TX completion and unlock the locks acquired within the scope of the TX.
@@ -88,7 +96,8 @@
lockManager.manageReverseRemove(ctx.getGlobalTransaction(), childNode, true,
null);
n = childNode;
}
- } else
+ }
+ else
{
lockManager.acquireLocksWithTimeout(ctx, command.getFqn(),
NodeLock.LockType.WRITE, true, false, false, true, null, false);
}
@@ -97,6 +106,18 @@
return retVal;
}
+ // TODO: This is unused. I'm guessing that is a bug?!?? This does need to be
checked.
+
+// protected boolean skipMethodCall(InvocationContext ctx)
+// {
+// return (supressLocking(ctx) &&
!MethodDeclarations.isPutMethod(ctx.getMethodCall().getMethodId()));
+// }
+
+// private boolean supressLocking(InvocationContext ctx)
+// {
+// return ctx.getOptionOverrides() != null &&
ctx.getOptionOverrides().isSuppressLocking();
+// }
+
public Object handlePrepareCommand(InvocationContext ctx, PrepareCommand command)
throws Throwable
{
// 2-phase commit prepares are no-ops here.
@@ -128,7 +149,8 @@
if (entry == null)
{
log.error("entry for transaction " + command.getGlobalTransaction() +
" not found (transaction has possibly already been rolled back)");
- } else
+ }
+ else
{
for (Fqn fqn : entry.getRemovedNodes())
{
@@ -302,10 +324,3 @@
}
}
}
-
-/*
-* todo refactorings ideas
-* - thre are many places in code that handles that coputes the lock owners: either
GTX or Thread.local. The
-* lockOwner can be abstractised as a LockOwner that can be extended by
CurrentThreadLock owner and
- GlobalTransaction owner. This would make the code nicer.
-*/