[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic ...

Ben Wang bwang at jboss.com
Tue Sep 5 02:11:25 EDT 2006


  User: bwang   
  Date: 06/09/05 02:11:25

  Modified:    src-50/org/jboss/cache/pojo/interceptors/dynamic 
                        CacheFieldInterceptor.java
  Log:
  First cuto of the using 2.0 Cache API
  
  Revision  Changes    Path
  1.10      +7 -4      JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic/CacheFieldInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheFieldInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic/CacheFieldInterceptor.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- CacheFieldInterceptor.java	27 Jul 2006 14:25:27 -0000	1.9
  +++ CacheFieldInterceptor.java	5 Sep 2006 06:11:25 -0000	1.10
  @@ -18,8 +18,10 @@
   import org.jboss.aop.joinpoint.Invocation;
   import org.jboss.aop.joinpoint.MethodInvocation;
   import org.jboss.cache.Fqn;
  +import org.jboss.cache.CacheSPI;
   import org.jboss.cache.pojo.memory.FieldPersistentReference;
   import org.jboss.cache.pojo.util.AopUtil;
  +import org.jboss.cache.pojo.util.CacheApiUtil;
   import org.jboss.cache.pojo.PojoTreeCache;
   import org.jboss.cache.pojo.CachedType;
   import org.jboss.cache.pojo.PojoInstance;
  @@ -38,7 +40,7 @@
   public class CacheFieldInterceptor implements BaseInterceptor
   {
      private final Log log_ = LogFactory.getLog(CacheFieldInterceptor.class);
  -   private PojoTreeCache cache_;
  +   private CacheSPI cache_;
      private PojoCacheImpl pCache_;
      private CachedType type_;
      private Fqn fqn_;
  @@ -48,7 +50,7 @@
      public CacheFieldInterceptor(PojoCacheImpl pCache, Fqn fqn, CachedType type)
      {
         this.pCache_ = pCache;
  -      cache_ = (PojoTreeCache)this.pCache_.getCache();
  +      cache_ = (CacheSPI)this.pCache_.getCache();
         this.fqn_ = fqn;
         this.type_ = type;
      }
  @@ -209,7 +211,8 @@
      private boolean isPojoDetached(Invocation invocation)
      {
         boolean detached = false;
  -      if (!cache_.exists(fqn_, PojoInstance.KEY))
  +
  +      if(!CacheApiUtil.exists(cache_, fqn_, PojoInstance.KEY))
         {
            detached = true;
            Object obj = invocation.getTargetObject();
  @@ -231,7 +234,7 @@
   
      protected void checkCacheConsistency() throws Exception
      {
  -      if (this != cache_.peek(fqn_, PojoInstance.KEY))
  +      if (this != cache_.get(fqn_, PojoInstance.KEY))
         {
            throw new RuntimeException("Cache inconsistency: Outdated PojoInstance");
         }
  
  
  



More information about the jboss-cvs-commits mailing list