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

Ben Wang bwang at jboss.com
Thu Jul 27 10:25:26 EDT 2006


  User: bwang   
  Date: 06/07/27 10:25:26

  Modified:    src-50/org/jboss/cache/pojo/collection   
                        CachedListImpl.java CachedMapImpl.java
                        CachedSetImpl.java
  Log:
  Moved the interceptor annotation and also now lock parent node for Collection.
  
  Revision  Changes    Path
  1.7       +11 -11    JBossCache/src-50/org/jboss/cache/pojo/collection/CachedListImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CachedListImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/collection/CachedListImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- CachedListImpl.java	16 Jul 2006 03:29:26 -0000	1.6
  +++ CachedListImpl.java	27 Jul 2006 14:25:26 -0000	1.7
  @@ -105,7 +105,7 @@
         {
            if (index != 0)
               checkIndex(); // Since index can be size().
  -         return Null.toNullValue(pCache_.putObject(AopUtil.constructFqn(getFqn(),
  +         return Null.toNullValue(pCache_.attach(AopUtil.constructFqn(getFqn(),
                    Integer.toString(index)), Null.toNullObject(element)));
         } catch (Exception e)
         {
  @@ -121,10 +121,10 @@
               checkIndex(); // Since index can be size().
            for (int i = size(); i > index; i--)
            {
  -            Object obj = pCache_.removeObject(AopUtil.constructFqn(getFqn(), Integer.toString(i - 1)));
  -            pCache_.putObject(AopUtil.constructFqn(getFqn(), Integer.toString(i)), obj);
  +            Object obj = pCache_.detach(AopUtil.constructFqn(getFqn(), Integer.toString(i - 1)));
  +            pCache_.attach(AopUtil.constructFqn(getFqn(), Integer.toString(i)), obj);
            }
  -         pCache_.putObject(AopUtil.constructFqn(getFqn(), Integer.toString(index)), Null.toNullObject(element));
  +         pCache_.attach(AopUtil.constructFqn(getFqn(), Integer.toString(index)), Null.toNullObject(element));
         } catch (Exception e)
         {
            throw new RuntimeException(e);
  @@ -179,15 +179,15 @@
            checkIndex();
            // Object result = cache.removeObject(((Fqn) fqn.clone()).add(new Integer(index)));
            int size = size();
  -         Object result = Null.toNullValue(pCache_.removeObject(AopUtil.constructFqn(getFqn(), Integer.toString(index))));
  +         Object result = Null.toNullValue(pCache_.detach(AopUtil.constructFqn(getFqn(), Integer.toString(index))));
            if (size == (index + 1))
            {
               return result; // We are the last one.
            }
            for (int i = index; i < size - 1; i++)
            {
  -            Object obj = pCache_.removeObject(AopUtil.constructFqn(getFqn(), Integer.toString(i + 1)));
  -            pCache_.putObject(AopUtil.constructFqn(getFqn(), Integer.toString(i)), obj);
  +            Object obj = pCache_.detach(AopUtil.constructFqn(getFqn(), Integer.toString(i + 1)));
  +            pCache_.attach(AopUtil.constructFqn(getFqn(), Integer.toString(i)), obj);
            }
            return result;
         } catch (Exception e)
  @@ -242,16 +242,16 @@
                  if (current < (size - 1))
                  {
                     // Need to reshuffle the items.
  -                  Object last = pCache_.removeObject(AopUtil.constructFqn(getFqn(), Integer.toString(current)));
  +                  Object last = pCache_.detach(AopUtil.constructFqn(getFqn(), Integer.toString(current)));
                     for (int i = current + 1; i < size; i++)
                     {
  -                     last = pCache_.removeObject(AopUtil.constructFqn(getFqn(), Integer.toString(i)));
  -                     pCache_.putObject(AopUtil.constructFqn(getFqn(), Integer.toString(i - 1)), last);
  +                     last = pCache_.detach(AopUtil.constructFqn(getFqn(), Integer.toString(i)));
  +                     pCache_.attach(AopUtil.constructFqn(getFqn(), Integer.toString(i - 1)), last);
                     }
                  } else
                  { // we are the last index.
                     // Need to move back the cursor.
  -                  pCache_.removeObject(AopUtil.constructFqn(getFqn(), Integer.toString(current)));
  +                  pCache_.detach(AopUtil.constructFqn(getFqn(), Integer.toString(current)));
                  }
                  current--;
                  size--;
  
  
  
  1.9       +3 -3      JBossCache/src-50/org/jboss/cache/pojo/collection/CachedMapImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CachedMapImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/collection/CachedMapImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- CachedMapImpl.java	13 Jul 2006 15:56:12 -0000	1.8
  +++ CachedMapImpl.java	27 Jul 2006 14:25:26 -0000	1.9
  @@ -92,7 +92,7 @@
      {
         try
         {
  -         return pCache_.putObject(constructFqn(getFqn(), Null.toNullKeyObject(key)), Null.toNullObject(value));
  +         return pCache_.attach(constructFqn(getFqn(), Null.toNullKeyObject(key)), Null.toNullObject(value));
         } catch (Exception e)
         {
            throw new RuntimeException(e);
  @@ -112,7 +112,7 @@
      {
         try
         {
  -         return pCache_.removeObject(constructFqn(getFqn(), Null.toNullKeyObject(key)));
  +         return pCache_.detach(constructFqn(getFqn(), Null.toNullKeyObject(key)));
         } catch (Exception e)
         {
            throw new RuntimeException(e);
  @@ -398,7 +398,7 @@
         {
            try
            {
  -            return pCache_.putObject(constructFqn(getFqn(), key), Null.toNullObject(value));
  +            return pCache_.attach(constructFqn(getFqn(), key), Null.toNullObject(value));
            } catch (Exception e)
            {
               throw new RuntimeException(e);
  
  
  
  1.6       +3 -15     JBossCache/src-50/org/jboss/cache/pojo/collection/CachedSetImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CachedSetImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/collection/CachedSetImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- CachedSetImpl.java	13 Jul 2006 15:56:12 -0000	1.5
  +++ CachedSetImpl.java	27 Jul 2006 14:25:26 -0000	1.6
  @@ -93,14 +93,8 @@
         while (keys.contains((keyString = Integer.toString(key))))
            key++;
   
  -      try
  -      {
  -         pCache_.putObject(AopUtil.constructFqn(getFqn(), keyString), Null.toNullObject(o));
  +      pCache_.attach(AopUtil.constructFqn(getFqn(), keyString), Null.toNullObject(o));
            return true;
  -      } catch (CacheException e)
  -      {
  -         throw new RuntimeException(e);
  -      }
      }
   
      public boolean contains(Object o)
  @@ -231,13 +225,7 @@
               throw new IllegalStateException();
            }
   
  -         try
  -         {
  -            pCache_.removeObject(AopUtil.constructFqn(getFqn(), this.key));
  -         } catch (CacheException e)
  -         {
  -            throw new RuntimeException(e);
  -         }
  +         pCache_.detach(AopUtil.constructFqn(getFqn(), this.key));
         }
   
      }
  
  
  



More information about the jboss-cvs-commits mailing list