Author: rareddy
Date: 2011-01-17 07:58:20 -0500 (Mon, 17 Jan 2011)
New Revision: 2841
Modified:
branches/7.1.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ExpirationAwareCache.java
Log:
TEIID-1439: When the keys are read back back expiration cache, the "expiration"
key should be transparent to the user so as to not to mistake this as the actual cache
key. To have a separate key is side effect of using the JBC, and should be contained here
in this class.
Modified:
branches/7.1.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ExpirationAwareCache.java
===================================================================
---
branches/7.1.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ExpirationAwareCache.java 2011-01-13
01:40:52 UTC (rev 2840)
+++
branches/7.1.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ExpirationAwareCache.java 2011-01-17
12:58:20 UTC (rev 2841)
@@ -21,6 +21,9 @@
*/
package org.teiid.cache.jboss;
+import java.util.HashSet;
+import java.util.Set;
+
import org.jboss.cache.Cache;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
@@ -47,4 +50,20 @@
child.put(ExpirationAlgorithmConfig.EXPIRATION_KEY, future);
return (V)child.put(key, value);
}
+
+ @Override
+ public Set<K> keys() {
+ HashSet keys = new HashSet();
+ Node<K, V> node = getRootNode();
+ Set<Node<K, V>> children = node.getChildren();
+ for (Node<K, V> child:children) {
+ for (K key:child.getData().keySet()) {
+ if ((key instanceof String) &&
(key.equals(ExpirationAlgorithmConfig.EXPIRATION_KEY))) {
+ continue;
+ }
+ keys.add(key);
+ }
+ }
+ return keys;
+ }
}
Show replies by date