[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/util ...
Ben Wang
bwang at jboss.com
Mon Oct 9 04:11:35 EDT 2006
User: bwang
Date: 06/10/09 04:11:35
Modified: src-50/org/jboss/cache/pojo/util AopUtil.java
Log:
Introduce __JBossInteral__ under a region, if set.
Revision Changes Path
1.8 +7 -39 JBossCache/src-50/org/jboss/cache/pojo/util/AopUtil.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AopUtil.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/util/AopUtil.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- AopUtil.java 31 Jul 2006 05:13:23 -0000 1.7
+++ AopUtil.java 9 Oct 2006 08:11:34 -0000 1.8
@@ -12,6 +12,8 @@
import org.jboss.aop.InstanceAdvisor;
import org.jboss.aop.advice.Interceptor;
import org.jboss.cache.Fqn;
+import org.jboss.cache.Cache;
+import org.jboss.cache.Region;
import org.jboss.cache.pojo.interceptors.dynamic.BaseInterceptor;
import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
import org.jboss.cache.pojo.InternalConstant;
@@ -139,9 +141,10 @@
// return new Fqn(baseFqn, fqn);
}
- public static Fqn createInternalFqn()
+ public static Fqn createInternalFqn(Fqn fqn, Cache cache)
{
- String region = InvocationContext.getCurrent().getRegion();
+ boolean createIfAbsent = false;
+ Region region = cache.getRegion(fqn, createIfAbsent);
// Use guid that is cluster-wide unique.
GUID guid = new GUID();
if(region == null)
@@ -149,44 +152,9 @@
return new Fqn(InternalConstant.JBOSS_INTERNAL, Fqn.fromString(guid.toString()));
} else
{
- return new Fqn(InternalConstant.JBOSS_INTERNAL, getIdWithRegion(guid.toString()));
+ // Create it under region first.
+ return new Fqn(region.getFqn(), InternalConstant.JBOSS_INTERNAL_STRING, guid.toString());
}
}
- public static Fqn getIdWithRegion(String id)
- {
- String region = InvocationContext.getCurrent().getRegion();
- if(region == null)
- {
- return Fqn.fromString(id);
- } else
- {
- Fqn fqn= Fqn.fromString(region + SEPARATOR + id);
- if(log.isTraceEnabled())
- {
- log.trace("Appending ID with region. The new id is: " +fqn.toString());
- }
- return fqn;
- }
- }
-
-
- public static Fqn getIdWithRegion(Fqn id)
- {
- String region = InvocationContext.getCurrent().getRegion();
- if(region == null)
- {
- return id;
- } else
- {
- Fqn fqn= new Fqn(Fqn.fromString(region), id);
- if(log.isTraceEnabled())
- {
- log.trace("Appending ID with region. The new id is: " +fqn.toString());
- }
- return fqn;
- }
- }
-
-
}
More information about the jboss-cvs-commits
mailing list