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

Manik Surtani msurtani at jboss.com
Thu Jan 4 00:35:40 EST 2007


  User: msurtani
  Date: 07/01/04 00:35:40

  Modified:    src-50/org/jboss/cache/pojo   CachedType.java
                        PojoTreeCache.java
  Log:
  Major changes around nodes, and the way they interact with the interceptor stack.
  Also removed redundant methods in NodeSPI and removed the need for casting to NodeSPI in most cases.
  
  Revision  Changes    Path
  1.8       +5 -3      JBossCache/src-50/org/jboss/cache/pojo/CachedType.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CachedType.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/CachedType.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- CachedType.java	31 Dec 2006 02:08:40 -0000	1.7
  +++ CachedType.java	4 Jan 2007 05:35:40 -0000	1.8
  @@ -61,7 +61,7 @@
   
      // Java fields . Will use special FieldPersistentReference to prevent classloader leakage.
      private List fields = new ArrayList();
  -   private Map fieldMap = new HashMap(); // Name -> CachedAttribute
  +   private Map fieldMap = new HashMap();// Name -> CachedAttribute
   
      public CachedType()
      {
  @@ -75,7 +75,7 @@
   
      public Class getType()
      {
  -      return (Class) type.get();
  +      return type.get();
      }
   
      // determines if the object should be stored in the Nodes map or as a subnode
  @@ -201,7 +201,9 @@
      private void analyzeFields(Class clazz)
      {
         if (clazz == null)
  +      {
            return;
  +      }
   
         analyzeFields(clazz.getSuperclass());
   
  @@ -355,4 +357,4 @@
                 && method.getReturnType() == Void.TYPE;
      }
   
  -} // CachedType
  +}// CachedType
  
  
  
  1.18      +6 -9      JBossCache/src-50/org/jboss/cache/pojo/PojoTreeCache.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PojoTreeCache.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/PojoTreeCache.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -b -r1.17 -r1.18
  --- PojoTreeCache.java	30 Dec 2006 17:49:56 -0000	1.17
  +++ PojoTreeCache.java	4 Jan 2007 05:35:40 -0000	1.18
  @@ -9,7 +9,7 @@
   import org.jboss.cache.CacheException;
   import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.Node;
  +import org.jboss.cache.NodeSPI;
   import org.jgroups.JChannel;
   import org.w3c.dom.Element;
   
  @@ -18,7 +18,7 @@
   public class PojoTreeCache extends CacheImpl
   {
      private Element config_ = null;
  -//   boolean detachPojoWhenEvicted_ = false;
  +   //   boolean detachPojoWhenEvicted_ = false;
   
      public PojoTreeCache(String cluster_name,
                           String props,
  @@ -42,7 +42,7 @@
      public void start() throws Exception
      {
         // Replace the default state transfer manager. TODO
  -//      setStateTransferManager(new PojoStateTransferManager(this));
  +      //      setStateTransferManager(new PojoStateTransferManager(this));
         super.start();
         parseConfig();
      }
  @@ -60,19 +60,16 @@
            log.info("parseConfig(): PojoCacheConfig is empty");
            return;
         }
  -//      detachPojoWhenEvicted_ = XmlHelper.readBooleanContents(config_, "DetachPojoWhenEvicted");
  +      //      detachPojoWhenEvicted_ = XmlHelper.readBooleanContents(config_, "DetachPojoWhenEvicted");
      }
   
      private boolean isAopNode(Fqn fqn)
      {
         // Use this API so it doesn't go thru the interceptor.
  -      Node node = peek(fqn);
  +      NodeSPI node = peek(fqn);
         if (node == null) return false;
   
  -      if (node.get(PojoInstance.KEY) != null)
  -         return true;
  -      else
  -         return false;
  +      return node.getDirect(PojoInstance.KEY) != null;
      }
   
      /**
  
  
  



More information about the jboss-cvs-commits mailing list