[jboss-cvs] JBossCache/src/org/jboss/cache/aop/util ...
Ben Wang
bwang at jboss.com
Tue Jan 2 02:19:05 EST 2007
User: bwang
Date: 07/01/02 02:19:05
Modified: src/org/jboss/cache/aop/util Tag: Branch_JBossCache_1_4_0
AopUtil.java
Log:
JBCACHE-909 CacheLoader and Collection.
Revision Changes Path
No revision
No revision
1.5.2.1 +30 -0 JBossCache/src/org/jboss/cache/aop/util/Attic/AopUtil.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AopUtil.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/aop/util/Attic/AopUtil.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -b -r1.5 -r1.5.2.1
--- AopUtil.java 9 Apr 2006 12:33:48 -0000 1.5
+++ AopUtil.java 2 Jan 2007 07:19:05 -0000 1.5.2.1
@@ -12,9 +12,14 @@
import org.jboss.aop.InstanceAdvisor;
import org.jboss.aop.advice.Interceptor;
import org.jboss.cache.Fqn;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.DataNode;
import org.jboss.cache.aop.BaseInterceptor;
import org.jboss.cache.aop.CacheInterceptor;
+import org.jboss.cache.aop.PojoCache;
+
import java.io.Serializable;
+import java.util.Set;
/**
* Unitlity methods for put, get and remove Collection classes object.
@@ -124,4 +129,29 @@
// return new Fqn(baseFqn, fqn);
}
+
+ public static DataNode get(PojoCache cache, Fqn fqn) throws CacheException
+ {
+ if (cache.getCacheLoader() != null)
+ {
+ // We have cache loader, we can't get it directly from the local get.
+ return cache.get(fqn);
+ } else
+ {
+ return cache._get(fqn);
+ }
+ }
+
+ public static Set getNodeChildren(PojoCache cache, Fqn fqn) throws CacheException
+ {
+ if (cache.getCacheLoader() != null)
+ {
+ // We have cache loader, we can't get it directly from the local get.
+ return cache.getChildrenNames(fqn);
+ } else
+ {
+ return cache._getChildrenNames(fqn);
+ }
+ }
+
}
More information about the jboss-cvs-commits
mailing list