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

Ben Wang bwang at jboss.com
Mon Jul 17 05:07:08 EDT 2006


  User: bwang   
  Date: 06/07/17 05:07:08

  Modified:    src-50/org/jboss/cache/pojo/interceptors/dynamic   
                        AbstractCollectionInterceptor.java
                        BaseInterceptor.java CacheFieldInterceptor.java
  Log:
  First cut of new internal object mapping using flat space.
  
  Revision  Changes    Path
  1.4       +7 -7      JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic/AbstractCollectionInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AbstractCollectionInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic/AbstractCollectionInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- AbstractCollectionInterceptor.java	14 Jul 2006 16:35:48 -0000	1.3
  +++ AbstractCollectionInterceptor.java	17 Jul 2006 09:07:08 -0000	1.4
  @@ -8,20 +8,20 @@
   package org.jboss.cache.pojo.interceptors.dynamic;
   
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.pojo.PojoReference;
  +import org.jboss.cache.pojo.PojoInstance;
   
   /**
    * Abstract base class for collection interceptor.
    *
    * @author Ben Wang
  - * @version $Id: AbstractCollectionInterceptor.java,v 1.3 2006/07/14 16:35:48 bwang Exp $
  + * @version $Id: AbstractCollectionInterceptor.java,v 1.4 2006/07/17 09:07:08 bwang Exp $
    */
   @SuppressWarnings({"CanBeFinal"})
   public abstract class AbstractCollectionInterceptor implements BaseInterceptor
   {
      Fqn fqn_;
      private boolean attached_ = true;
  -   private PojoReference pojoReference_;
  +   private PojoInstance pojoInstance_;
   
      @SuppressWarnings({"CanBeFinal"})
      public Fqn getFqn()
  @@ -36,14 +36,14 @@
      }
   
      @SuppressWarnings({"CanBeFinal"})
  -   public PojoReference getAopInstance()
  +   public PojoInstance getAopInstance()
      {
  -      return pojoReference_;
  +      return pojoInstance_;
      }
   
  -   public void setAopInstance(PojoReference pojoReference)
  +   public void setAopInstance(PojoInstance pojoInstance)
      {
  -      this.pojoReference_ = pojoReference;
  +      this.pojoInstance_ = pojoInstance;
      }
   
      /**
  
  
  
  1.3       +3 -3      JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic/BaseInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BaseInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic/BaseInterceptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- BaseInterceptor.java	12 Jul 2006 13:28:25 -0000	1.2
  +++ BaseInterceptor.java	17 Jul 2006 09:07:08 -0000	1.3
  @@ -7,7 +7,7 @@
   package org.jboss.cache.pojo.interceptors.dynamic;
   
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.pojo.PojoReference;
  +import org.jboss.cache.pojo.PojoInstance;
   import org.jboss.aop.advice.Interceptor;
   
   
  @@ -27,9 +27,9 @@
   
      void setFqn(Fqn fqn);
   
  -   PojoReference getAopInstance();
  +   PojoInstance getAopInstance();
   
  -   void setAopInstance(PojoReference pojoReference);
  +   void setAopInstance(PojoInstance pojoInstance);
   
      void setInterceptor(Interceptor interceptor);
   }
  
  
  
  1.6       +13 -10    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.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- CacheFieldInterceptor.java	13 Jul 2006 16:53:13 -0000	1.5
  +++ CacheFieldInterceptor.java	17 Jul 2006 09:07:08 -0000	1.6
  @@ -22,8 +22,7 @@
   import org.jboss.cache.pojo.util.AopUtil;
   import org.jboss.cache.pojo.PojoTreeCache;
   import org.jboss.cache.pojo.CachedType;
  -import org.jboss.cache.pojo.PojoReference;
  -import org.jboss.cache.pojo.InternalConstant;
  +import org.jboss.cache.pojo.PojoInstance;
   import org.jboss.cache.pojo.impl.PojoCacheImpl;
   
   import java.lang.reflect.Field;
  @@ -43,7 +42,7 @@
      private CachedType type_;
      private Fqn fqn_;
      private String name_;
  -   private PojoReference pojoReference_;
  +   private PojoInstance pojoInstance_;
   
      public CacheFieldInterceptor(PojoCacheImpl pCache, Fqn fqn, CachedType type)
      {
  @@ -57,9 +56,9 @@
      {
      }
   
  -   public PojoReference getAopInstance()
  +   public PojoInstance getAopInstance()
      {
  -      return pojoReference_;
  +      return pojoInstance_;
      }
   
      public Object clone()
  @@ -77,9 +76,9 @@
         setAopInstance(interceptor.getAopInstance());
      }
   
  -   public void setAopInstance(PojoReference pojoReference)
  +   public void setAopInstance(PojoInstance pojoInstance)
      {
  -      this.pojoReference_ = pojoReference;
  +      this.pojoInstance_ = pojoInstance;
      }
   
      public String getName()
  @@ -112,6 +111,10 @@
   
            Advisor advisor = fieldInvocation.getAdvisor();
            Field field = fieldInvocation.getField();
  +         if(log_.isTraceEnabled())
  +         {
  +            log_.trace("invoke(): field write interception for " +field);
  +         }
   
            // Only if this field is replicatable. static, transient and final are not.
            CachedType fieldType = pCache_.getCachedType(field.getType());
  @@ -213,7 +216,7 @@
      private boolean isPojoDetached(Invocation invocation)
      {
         boolean detached = false;
  -      if (!cache_.exists(fqn_, InternalConstant.CLASS_INTERNAL))
  +      if (!cache_.exists(fqn_, PojoInstance.KEY))
         {
            detached = true;
            Object obj = invocation.getTargetObject();
  @@ -237,9 +240,9 @@
   
      protected void checkCacheConsistency() throws Exception
      {
  -      if (this != cache_.peek(fqn_, PojoReference.KEY))
  +      if (this != cache_.peek(fqn_, PojoInstance.KEY))
         {
  -         throw new RuntimeException("Cache inconsistency: Outdated PojoReference");
  +         throw new RuntimeException("Cache inconsistency: Outdated PojoInstance");
         }
      }
   
  
  
  



More information about the jboss-cvs-commits mailing list