[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
msurtani at jboss.com
Sat Dec 30 21:08:41 EST 2006
User: msurtani
Date: 06/12/30 21:08:41
Modified: src/org/jboss/cache TreeCacheView.java CacheImpl.java
UnversionedNode.java Fqn.java
Log:
Updates to tests to go along with changes in node methods
Revision Changes Path
1.19 +5 -5 JBossCache/src/org/jboss/cache/TreeCacheView.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TreeCacheView.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TreeCacheView.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- TreeCacheView.java 30 Dec 2006 17:49:54 -0000 1.18
+++ TreeCacheView.java 31 Dec 2006 02:08:40 -0000 1.19
@@ -53,7 +53,7 @@
* The view itself caches only the nodes, but doesn't cache any of the data (HashMap) associated with it. When
* data needs to be displayed, the underlying cache will be accessed directly.
*
- * @version $Revision: 1.18 $
+ * @version $Revision: 1.19 $
* @author<a href="mailto:bela at jboss.org">Bela Ban</a> March 27 2003
*/
public class TreeCacheView implements TreeCacheViewMBean
@@ -346,7 +346,7 @@
JTree jtree = null;
DefaultTableModel table_model = new DefaultTableModel();
JTable table = new JTable(table_model);
- MyNode root = new MyNode(SEP.getName());
+ MyNode root = new MyNode(SEP.getLastElementAsString());
Fqn selected_node = null;
JPanel tablePanel = null;
JMenu operationsMenu = null;
@@ -363,7 +363,7 @@
//server.invoke(cache_service, "addTreeCacheListener",
// new Object[]{this},
- // new String[]{TreeCacheListener.class.getName()});
+ // new String[]{TreeCacheListener.class.getLastElementAsString()});
cache.getNotifier().addCacheListener(this);
addNotify();
setTitle("TreeCacheGui: mbr=" + getLocalAddress());
@@ -478,8 +478,8 @@
// server.invoke(cache_service, "put",
// new Object[]{selected_node, key, val},
-// new String[]{String.class.getName(),
-// String.class.getName(), Object.class.getName()});
+// new String[]{String.class.getLastElementAsString(),
+// String.class.getLastElementAsString(), Object.class.getLastElementAsString()});
try
{
cache.put(selected_node, key, val);
1.3 +7 -7 JBossCache/src/org/jboss/cache/CacheImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- CacheImpl.java 30 Dec 2006 19:48:46 -0000 1.2
+++ CacheImpl.java 31 Dec 2006 02:08:40 -0000 1.3
@@ -98,7 +98,7 @@
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
* @author Brian Stansberry
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Id: CacheImpl.java,v 1.2 2006/12/30 19:48:46 msurtani Exp $
+ * @version $Id: CacheImpl.java,v 1.3 2006/12/31 02:08:40 msurtani Exp $
* <p/>
* @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
*/
@@ -1750,7 +1750,7 @@
public Set getChildrenNames(Fqn fqn) throws CacheException
{
MethodCall m = MethodCallFactory.create(MethodDeclarations.getChildrenNamesMethodLocal, fqn);
- return (Set) invokeMethod(m);
+ return Collections.unmodifiableSet(new HashSet((Set) invokeMethod(m)));
}
public Set _getChildrenNames(Fqn fqn) throws CacheException
@@ -2408,7 +2408,7 @@
// remove subtree from parent
if (eviction || configuration.isNodeLockingOptimistic())
{
- parent_node.getNodeSPI().getChildrenMap().remove(n.getFqn().getLast());
+ parent_node.getNodeSPI().getChildrenMap().remove(n.getFqn().getLastElement());
}
else
{
@@ -2427,7 +2427,7 @@
// this modification) and put it into the TX's undo list.
if (tx != null && create_undo_ops && !eviction)
{
- undo_op = MethodCallFactory.create(MethodDeclarations.addChildMethodLocal, tx, parent_node.getFqn(), n.getFqn().getLast(), n, false);
+ undo_op = MethodCallFactory.create(MethodDeclarations.addChildMethodLocal, tx, parent_node.getFqn(), n.getFqn().getLastElement(), n, false);
// 1. put undo-op in TX' undo-operations list (needed to rollback TX)
tx_table.addUndoOperation(tx, undo_op);
@@ -3174,7 +3174,7 @@
}
NodeSPI oldParent = (NodeSPI) node.getParent();
- Object nodeName = nodeToMoveFqn.getLast();
+ Object nodeName = nodeToMoveFqn.getLastElement();
// now that we have the parent and target nodes:
// first correct the pointers at the pruning point
@@ -3189,7 +3189,7 @@
// now register an undo op
if (getInvocationContext().getTransaction() != null)
{
- MethodCall undo = MethodCallFactory.create(MethodDeclarations.moveMethodLocal, oldParent.getFqn(), new Fqn(newParentFqn, nodeToMoveFqn.getLast()));
+ MethodCall undo = MethodCallFactory.create(MethodDeclarations.moveMethodLocal, oldParent.getFqn(), new Fqn(newParentFqn, nodeToMoveFqn.getLastElement()));
tx_table.addUndoOperation(getInvocationContext().getGlobalTransaction(), undo);
}
}
@@ -3206,7 +3206,7 @@
private void moveFqns(Node node, Fqn newBase)
{
- Fqn newFqn = new Fqn(newBase, node.getFqn().getLast());
+ Fqn newFqn = new Fqn(newBase, node.getFqn().getLastElement());
node.getNodeSPI().setFqn(newFqn);
}
1.2 +6 -6 JBossCache/src/org/jboss/cache/UnversionedNode.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UnversionedNode.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/UnversionedNode.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- UnversionedNode.java 30 Dec 2006 17:49:54 -0000 1.1
+++ UnversionedNode.java 31 Dec 2006 02:08:41 -0000 1.2
@@ -142,7 +142,7 @@
}
this.cache = cache;
this.fqn = fqn;
- if (!fqn.isRoot() && !child_name.equals(fqn.getLast()))
+ if (!fqn.isRoot() && !child_name.equals(fqn.getLastElement()))
{
throw new IllegalArgumentException("Child " + child_name + " must be last part of " + fqn);
}
@@ -505,7 +505,7 @@
if (f.size() == 1)
{
- newNode = getOrCreateChild(f.getLast(), gtx);
+ newNode = getOrCreateChild(f.getLastElement(), gtx);
}
else
{
@@ -563,7 +563,7 @@
{
try
{
- Node child = getChild(fqn.getLast());
+ Node child = getChild(fqn.getLastElement());
cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
return child;
}
@@ -630,13 +630,13 @@
{
if (fqn.size() == 1)
{
- children.remove(fqn.getName());
+ children.remove(fqn.getLastElement());
}
else
{
Node c = getChild(fqn);
cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
- c.getParent().removeChild(new Fqn(fqn.getName()));
+ c.getParent().removeChild(new Fqn(fqn.getLastElement()));
}
cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
}
@@ -749,7 +749,7 @@
*/
public Object getName()
{
- return fqn.getLast();
+ return fqn.getLastElement();
}
/**
1.45 +5 -5 JBossCache/src/org/jboss/cache/Fqn.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Fqn.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Fqn.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- Fqn.java 30 Dec 2006 19:48:46 -0000 1.44
+++ Fqn.java 31 Dec 2006 02:08:41 -0000 1.45
@@ -42,7 +42,7 @@
* <p/>
* Another way to look at it is that the "/" separarator is only parsed when it form sa part of a String passed in to Fqn.fromString() and not otherwise.
*
- * @version $Revision: 1.44 $
+ * @version $Revision: 1.45 $
*/
public class Fqn implements Cloneable, Externalizable, Comparable<Fqn>
{
@@ -292,9 +292,9 @@
/**
* Returns the last element in the FQN.
*
- * @see #getName
+ * @see #getLastElementAsString
*/
- public Object getLast()
+ public Object getLastElement()
{
if (isRoot()) return SEPARATOR;
return elements.get(elements.size() - 1);
@@ -482,10 +482,10 @@
* Returns a String representation of the last element that makes up this Fqn.
* If this is the root, returns {@link Fqn#SEPARATOR}.
*/
- public String getName()
+ public String getLastElementAsString()
{
if (isRoot()) return SEPARATOR;
- else return String.valueOf(getLast());
+ else return String.valueOf(getLastElement());
}
/**
More information about the jboss-cvs-commits
mailing list