[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/util ...
Ben Wang
bwang at jboss.com
Tue Jan 2 07:27:41 EST 2007
User: bwang
Date: 07/01/02 07:27:41
Modified: src-50/org/jboss/cache/pojo/util CacheApiUtil.java
Log:
JBCACHE-907 Fixed size() problem with loader.
Revision Changes Path
1.5 +18 -7 JBossCache/src-50/org/jboss/cache/pojo/util/CacheApiUtil.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheApiUtil.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/util/CacheApiUtil.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- CacheApiUtil.java 30 Dec 2006 17:50:00 -0000 1.4
+++ CacheApiUtil.java 2 Jan 2007 12:27:41 -0000 1.5
@@ -10,25 +10,36 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.config.Option;
import java.util.Map;
+import java.util.Set;
/**
* Utility for the 2.0 Cache API
*
* @author Ben Wang
- * @version $Id: CacheApiUtil.java,v 1.4 2006/12/30 17:50:00 msurtani Exp $
+ * @version $Id: CacheApiUtil.java,v 1.5 2007/01/02 12:27:41 bwang Exp $
*/
public class CacheApiUtil
{
- public static Node getDataNode(CacheSPI cache, Fqn fqn)
+
+ public static Set<Node> getNodeChildren(CacheSPI cache, Fqn fqn)
{
-// cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
- Node node = cache.getRoot().getChild(fqn);
- if (node == null) return null;
+ Node n = cache.getRoot().getChild(fqn);
+ if(n == null) return null;
-// cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
- return node;
+ if (cache.getCacheLoader() != null)
+ {
+ // We have cache loader, we can't get it directly from the local get.
+ return n.getChildren();
+ } else
+ {
+ Option option = cache.getInvocationContext().getOptionOverrides();
+ // WIll run into some race error in LocalTest for Set.
+// option.setBypassInterceptorChain(true);
+ return n.getChildren();
+ }
}
public static boolean exists(CacheSPI cache, Fqn fqn, Object key)
More information about the jboss-cvs-commits
mailing list