[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Manik Surtani
manik at jboss.org
Fri Apr 20 08:10:12 EDT 2007
User: msurtani
Date: 07/04/20 08:10:12
Modified: src/org/jboss/cache/interceptors
InvalidationInterceptor.java
Log:
JBCACHE-1027
Revision Changes Path
1.32 +46 -20 JBossCache/src/org/jboss/cache/interceptors/InvalidationInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: InvalidationInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/InvalidationInterceptor.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- InvalidationInterceptor.java 28 Feb 2007 18:22:54 -0000 1.31
+++ InvalidationInterceptor.java 20 Apr 2007 12:10:12 -0000 1.32
@@ -70,6 +70,8 @@
// now see if this is a CRUD method:
if (MethodDeclarations.isCrudMethod(m.getMethodId()))
{
+ if (m.getMethodId() != MethodDeclarations.putForExternalReadMethodLocal_id)
+ {
if (log.isDebugEnabled()) log.debug("Is a CRUD method");
Fqn fqn = findFqn(m.getArgs());
if (fqn != null)
@@ -85,6 +87,11 @@
}
else
{
+ log.debug("Encountered a putForExternalRead() - is a no op.");
+ }
+ }
+ else
+ {
// not a CRUD method - lets see if it is a tx lifecycle method.
if (tx != null && isValid(tx))
{
@@ -102,6 +109,12 @@
if (modifications.size() > 0)
{
+ if (containsPutForExternalRead(modifications))
+ {
+ log.debug("Modification list contains a putForExternalRead operation. Not invalidating.");
+ }
+ else
+ {
try
{
invalidateModifications(modifications, configuration.isNodeLockingOptimistic() ? getWorkspace(gtx) : null);
@@ -123,7 +136,12 @@
throw new RuntimeException("Unable to broadcast invalidation messages", t);
}
}
- log.debug("Leaving InvalidationInterceptor's prepare phase");
+ }
+ else
+ {
+ log.debug("Nothing to invalidate - no modifications in the transaction.");
+ }
+
break;
}
}
@@ -132,6 +150,14 @@
return retval;
}
+ private boolean containsPutForExternalRead(List<MethodCall> l)
+ {
+ for (MethodCall m : l)
+ if (m.getMethodId() == MethodDeclarations.putForExternalReadMethodLocal_id || m.getMethodId() == MethodDeclarations.putForExternalReadVersionedMethodLocal_id)
+ return true;
+ return false;
+ }
+
public long getInvalidations()
{
return m_invalidations;
More information about the jboss-cvs-commits
mailing list