[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Manik Surtani
msurtani at jboss.com
Sat Dec 30 21:08:40 EST 2006
User: msurtani
Date: 06/12/30 21:08:40
Modified: src/org/jboss/cache/interceptors
OptimisticNodeInterceptor.java
PessimisticLockInterceptor.java
OptimisticInterceptor.java
CacheStoreInterceptor.java
OptimisticValidatorInterceptor.java
Log:
Updates to tests to go along with changes in node methods
Revision Changes Path
1.39 +8 -9 JBossCache/src/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OptimisticNodeInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- OptimisticNodeInterceptor.java 30 Dec 2006 19:48:46 -0000 1.38
+++ OptimisticNodeInterceptor.java 31 Dec 2006 02:08:40 -0000 1.39
@@ -120,10 +120,10 @@
{
case MethodDeclarations.putDataMethodLocal_id:
Boolean erase = (Boolean) args[3];
- putDataMap(args, erase, workspace, workspaceNode);
+ putDataMap((Map<Object, Object>) args[2], erase, workspace, workspaceNode);
break;
case MethodDeclarations.putDataEraseMethodLocal_id:
- putDataMap(args, true, workspace, workspaceNode);
+ putDataMap((Map<Object, Object>) args[2], true, workspace, workspaceNode);
break;
case MethodDeclarations.putKeyValMethodLocal_id:
result = putDataKeyValue(args, workspace, workspaceNode);
@@ -190,7 +190,7 @@
{
Fqn nodeFqn = node.getFqn();
WorkspaceNode oldParent = getOrCreateWorkspaceNode(nodeFqn.getParent(), ws);
- Object nodeName = nodeFqn.getLast();
+ Object nodeName = nodeFqn.getLastElement();
// now that we have the parent and target nodes:
// first correct the pointers at the pruning point
@@ -215,7 +215,7 @@
*/
private void moveFqns(WorkspaceNode node, Fqn newBase, TransactionWorkspace ws)
{
- Fqn newFqn = new Fqn(newBase, node.getFqn().getLast());
+ Fqn newFqn = new Fqn(newBase, node.getFqn().getLastElement());
WorkspaceNode movedNode = getOrCreateWorkspaceNode(newFqn, ws);
movedNode.put(node.getData());
@@ -255,16 +255,15 @@
return (Fqn) args[1];
}
- private void putDataMap(Object[] args, boolean eraseExisitng,
+ private void putDataMap(Map<Object, Object> data, boolean eraseExisitng,
TransactionWorkspace workspace, WorkspaceNode workspaceNode)
{
-
- Map data = (Map) args[2];
if (workspaceNode == null)
{
return;
}
- workspaceNode.put(data, eraseExisitng);
+ if (eraseExisitng) workspaceNode.clearData();
+ workspaceNode.put(data);
workspace.addNode(workspaceNode);
}
@@ -306,7 +305,7 @@
throw new CacheException("Unable to find parent node with Fqn " + parentFqn);
}
- parentNode.removeChild(new Fqn(workspaceNode.getFqn().getLast()));
+ parentNode.removeChild(new Fqn(workspaceNode.getFqn().getLastElement()));
workspace.addNode(parentNode);
if (debug) log.debug("added parent node " + parentNode.getFqn() + " to workspace");
Fqn nodeFqn = workspaceNode.getFqn();
1.40 +2 -2 JBossCache/src/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PessimisticLockInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/PessimisticLockInterceptor.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- PessimisticLockInterceptor.java 30 Dec 2006 17:49:53 -0000 1.39
+++ PessimisticLockInterceptor.java 31 Dec 2006 02:08:40 -0000 1.40
@@ -37,7 +37,7 @@
* current method and unlock when the method returns.
*
* @author Bela Ban
- * @version $Id: PessimisticLockInterceptor.java,v 1.39 2006/12/30 17:49:53 msurtani Exp $
+ * @version $Id: PessimisticLockInterceptor.java,v 1.40 2006/12/31 02:08:40 msurtani Exp $
*/
public class PessimisticLockInterceptor extends Interceptor
{
@@ -259,7 +259,7 @@
if (i == -1)
{
// this is the root node
- child_name = Fqn.ROOT.getName();
+ child_name = Fqn.ROOT.getLastElement();
child_node = cache.getRoot();
}
else
1.8 +1 -1 JBossCache/src/org/jboss/cache/interceptors/OptimisticInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OptimisticInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/OptimisticInterceptor.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- OptimisticInterceptor.java 20 Sep 2006 16:28:57 -0000 1.7
+++ OptimisticInterceptor.java 31 Dec 2006 02:08:40 -0000 1.8
@@ -57,7 +57,7 @@
protected void greedyGetFqns(List<Fqn> list, Node n, Fqn newBase)
{
list.add(n.getFqn());
- Fqn newFqn = new Fqn(newBase, n.getFqn().getLast());
+ Fqn newFqn = new Fqn(newBase, n.getFqn().getLastElement());
list.add(newFqn);
for (Node child : n.getChildren())
1.42 +2 -2 JBossCache/src/org/jboss/cache/interceptors/CacheStoreInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheStoreInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/CacheStoreInterceptor.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- CacheStoreInterceptor.java 30 Dec 2006 19:48:46 -0000 1.41
+++ CacheStoreInterceptor.java 31 Dec 2006 02:08:40 -0000 1.42
@@ -27,7 +27,7 @@
* through the CacheLoader, either after each method call (no TXs), or at TX commit.
*
* @author Bela Ban
- * @version $Id: CacheStoreInterceptor.java,v 1.41 2006/12/30 19:48:46 msurtani Exp $
+ * @version $Id: CacheStoreInterceptor.java,v 1.42 2006/12/31 02:08:40 msurtani Exp $
*/
public class CacheStoreInterceptor extends BaseCacheLoaderInterceptor implements CacheStoreInterceptorMBean
{
@@ -257,7 +257,7 @@
private void doMove(Fqn parent, Fqn node) throws Exception
{
- Fqn newNodeFqn = new Fqn(parent, node.getLast());
+ Fqn newNodeFqn = new Fqn(parent, node.getLastElement());
//UnversionedNode n = (UnversionedNode) ((TreeCacheProxyImpl) cache).peek(newNodeFqn);
//recursiveMove(n);
// throw new RuntimeException("Implement me!");
1.48 +1 -1 JBossCache/src/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OptimisticValidatorInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- OptimisticValidatorInterceptor.java 30 Dec 2006 17:49:53 -0000 1.47
+++ OptimisticValidatorInterceptor.java 31 Dec 2006 02:08:40 -0000 1.48
@@ -185,7 +185,7 @@
{
throw new IllegalStateException("dNode " + dNode + " has no parent");
}
- parent.removeChild(new Fqn(dNode.getFqn().getLast()));
+ parent.removeChild(new Fqn(dNode.getFqn().getLastElement()));
cache.getNotifier().notifyNodeRemoved(dNode.getFqn(), false, null);
}
}
More information about the jboss-cvs-commits
mailing list