[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
manik at jboss.org
Wed Aug 1 07:41:56 EDT 2007
User: msurtani
Date: 07/08/01 07:41:56
Modified: src/org/jboss/cache CacheImpl.java UnversionedNode.java
Log:
Should be using getData() on cache!
Revision Changes Path
1.110 +13 -0 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.109
retrieving revision 1.110
diff -u -b -r1.109 -r1.110
--- CacheImpl.java 30 Jul 2007 16:16:17 -0000 1.109
+++ CacheImpl.java 1 Aug 2007 11:41:56 -0000 1.110
@@ -1366,6 +1366,19 @@
}
+ /**
+ * Retrieves a defensively copied data map of the underlying node.
+ *
+ * @param fqn
+ * @return map of data, or an empty map
+ * @throws CacheException
+ */
+ public Map<K, V> getData(Fqn<?> fqn) throws CacheException
+ {
+ MethodCall m = MethodCallFactory.create(MethodDeclarations.getDataMapMethodLocal, fqn);
+ return (Map<K, V>) invokeMethod(m, true);
+ }
+
public Set _getKeys(Fqn<?> fqn) throws CacheException
{
NodeSPI<K, V> n = findNode(fqn);
1.43 +5 -1 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.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- UnversionedNode.java 30 Jul 2007 11:19:14 -0000 1.42
+++ UnversionedNode.java 1 Aug 2007 11:41:56 -0000 1.43
@@ -191,12 +191,16 @@
public Map<K, V> getData()
{
if (cache == null) return Collections.emptyMap();
+ return cache.getData(getFqn());
+
+/*
Map<K, V> dMap = new HashMap<K, V>();
for (K k : cache.getKeys(getFqn()))
{
dMap.put(k, cache.get(fqn, k));
}
return Collections.unmodifiableMap(dMap);
+*/
}
public Map<K, V> getDataDirect()
More information about the jboss-cvs-commits
mailing list