[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Manik Surtani
msurtani at jboss.com
Mon Jan 1 17:12:19 EST 2007
User: msurtani
Date: 07/01/01 17:12:19
Modified: src/org/jboss/cache/interceptors
CacheLoaderInterceptor.java
Log:
- FqnComparator should not be in the optimistic subpackage
- Fixed move() related issues
Revision Changes Path
1.67 +9 -8 JBossCache/src/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheLoaderInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/CacheLoaderInterceptor.java,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -b -r1.66 -r1.67
--- CacheLoaderInterceptor.java 31 Dec 2006 03:01:20 -0000 1.66
+++ CacheLoaderInterceptor.java 1 Jan 2007 22:12:19 -0000 1.67
@@ -29,7 +29,7 @@
* Loads nodes that don't exist at the time of the call into memory from the CacheLoader
*
* @author Bela Ban
- * @version $Id: CacheLoaderInterceptor.java,v 1.66 2006/12/31 03:01:20 msurtani Exp $
+ * @version $Id: CacheLoaderInterceptor.java,v 1.67 2007/01/01 22:12:19 msurtani Exp $
*/
public class CacheLoaderInterceptor extends BaseCacheLoaderInterceptor implements CacheLoaderInterceptorMBean
{
@@ -179,15 +179,16 @@
if (fqn != null)
{
- if (fqn2 != null) loadIfNeeded(fqn2, key, initNode, acquireLock, m, entry, false);
- loadIfNeeded(fqn, key, initNode, acquireLock, m, entry, recursive);
+ if (fqn2 != null)
+ loadIfNeeded(fqn2, key, initNode, acquireLock, m, entry, false, m.getMethodId() == MethodDeclarations.moveMethodLocal_id);
+ loadIfNeeded(fqn, key, initNode, acquireLock, m, entry, recursive, m.getMethodId() == MethodDeclarations.moveMethodLocal_id);
}
return super.invoke(m);
}
- private void loadIfNeeded(Fqn fqn, Object key, boolean initNode, boolean acquireLock, MethodCall m, TransactionEntry entry, boolean recursive) throws Throwable
+ private void loadIfNeeded(Fqn fqn, Object key, boolean initNode, boolean acquireLock, MethodCall m, TransactionEntry entry, boolean recursive, boolean isMove) throws Throwable
{
obtainLoaderLock(fqn);
@@ -232,7 +233,7 @@
// The complete list of children aren't known without loading them
if (recursive || m.getMethodId() == MethodDeclarations.getChildrenNamesMethodLocal_id)
{
- loadChildren(fqn, n, recursive);
+ loadChildren(fqn, n, recursive, isMove);
}
}
@@ -248,7 +249,7 @@
*
* @param node may be null if the node was not found.
*/
- private void loadChildren(Fqn fqn, Node node, boolean recursive) throws Throwable
+ private void loadChildren(Fqn fqn, Node node, boolean recursive, boolean isMove) throws Throwable
{
if (node != null && node.getNodeSPI().getChildrenLoaded())
@@ -289,7 +290,7 @@
cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
Node child = node.addChild(child_fqn);
Map childMap = child.getNodeSPI().getRawData();
- if (isActivation && recursive)
+ if ((isMove || isActivation) && recursive)
{
// load data for children as well!
childMap.putAll(loader.get(child.getFqn()));
@@ -301,7 +302,7 @@
}
if (recursive)
{
- loadChildren(child.getFqn(), child, true);
+ loadChildren(child.getFqn(), child, true, isMove);
}
}
lock(fqn, recursive ? NodeLock.LockType.WRITE : NodeLock.LockType.READ, true); // recursive=true: lock entire subtree
More information about the jboss-cvs-commits
mailing list