[jboss-cvs] JBossCache/src/org/jboss/cache/pojo/util ...
Jason Thomas Greene
jgreene at jboss.com
Wed Jun 27 20:56:07 EDT 2007
User: jgreene
Date: 07/06/27 20:56:07
Modified: src/org/jboss/cache/pojo/util CacheApiUtil.java
Log:
Reduce dependency on CacheSPI
Revision Changes Path
1.5 +6 -30 JBossCache/src/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/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 21 Jun 2007 01:33:03 -0000 1.4
+++ CacheApiUtil.java 28 Jun 2007 00:56:07 -0000 1.5
@@ -7,47 +7,23 @@
package org.jboss.cache.pojo.util;
-import org.jboss.cache.CacheSPI;
+import java.util.Set;
+
+import org.jboss.cache.Cache;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
-import org.jboss.cache.NodeSPI;
-
-import java.util.Set;
/**
* Utility for the 2.0 Cache API
*
* @author Ben Wang
- * @version $Id: CacheApiUtil.java,v 1.4 2007/06/21 01:33:03 jgreene Exp $
+ * @version $Id: CacheApiUtil.java,v 1.5 2007/06/28 00:56:07 jgreene Exp $
*/
public class CacheApiUtil
{
- public static Node XgetDataNode(CacheSPI cache, Fqn fqn)
- {
- // cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
- Node node = cache.getRoot().getChild(fqn);
- if (node == null) return null;
-
- // cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
- return node;
- }
-
- public static Set<Node> getNodeChildren(CacheSPI cache, Fqn fqn)
+ public static Set<Node> getNodeChildren(Cache<Object, Object> cache, Fqn fqn)
{
Node n = cache.getRoot().getChild(fqn);
- if (n == null) return null;
-
- if (cache.getCacheLoaderManager() != 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();
- }
+ return n != null ? n.getChildren() : null;
}
}
More information about the jboss-cvs-commits
mailing list