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

Manik Surtani msurtani at jboss.com
Tue Dec 12 10:08:06 EST 2006


  User: msurtani
  Date: 06/12/12 10:08:06

  Modified:    src/org/jboss/cache  NodeImpl.java
  Log:
  Cleaned up some stuff around resetting bypassInterceptorChain option
  
  Revision  Changes    Path
  1.24      +85 -48    JBossCache/src/org/jboss/cache/NodeImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/NodeImpl.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -b -r1.23 -r1.24
  --- NodeImpl.java	11 Dec 2006 21:14:34 -0000	1.23
  +++ NodeImpl.java	12 Dec 2006 15:08:05 -0000	1.24
  @@ -274,6 +274,8 @@
      {
         if (cache.getInvocationContext().getOptionOverrides().isBypassInterceptorChain())
         {
  +         try
  +         {
            if (data == null)
            {
               return;
  @@ -293,8 +295,12 @@
               }
               data().putAll(data);
            }
  +         }
  +         finally
  +         {
            cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
         }
  +      }
         else
         {
            // TODO add erase option to Cache (?)
  @@ -311,11 +317,17 @@
         if (cache.getInvocationContext().getOptionOverrides().isBypassInterceptorChain())
         {
            Object result;
  +         try
  +         {
            synchronized (this)
            {
               result = data().put(key, value);
            }
  +         }
  +         finally
  +         {
            cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
  +         }
            return result;
         }
         else
  @@ -401,6 +413,8 @@
         if (cache.getInvocationContext().getOptionOverrides().isBypassInterceptorChain())
         {
            Object result;
  +         try
  +         {
            synchronized (this)
            {
               if (data == null)
  @@ -412,7 +426,11 @@
                  result = data.remove(key);
               }
            }
  +         }
  +         finally
  +         {
            cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
  +         }
            return result;
         }
         else
  @@ -487,6 +505,8 @@
         if (cache.getInvocationContext().getOptionOverrides().isBypassInterceptorChain())
         {
            Node newNode = this;
  +         try
  +         {
            GlobalTransaction gtx = cache.getInvocationContext().getGlobalTransaction();
   
            if (f.size() == 1)
  @@ -503,8 +523,11 @@
                  currentParent = newNode;
               }
            }
  -
  +         }
  +         finally
  +         {
            cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
  +         }
            return newNode;
         }
         else
  @@ -519,6 +542,8 @@
      {
         if (cache.getInvocationContext().getOptionOverrides().isBypassInterceptorChain())
         {
  +         try
  +         {
            synchronized (this)
            {
               if (data != null)
  @@ -527,6 +552,11 @@
               }
            }
         }
  +         finally
  +         {
  +            cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
  +         }
  +      }
         else
         {
            ((TreeCacheProxyImpl) cache).treeCache.removeData(getFqn());
  @@ -537,10 +567,17 @@
      {
         if (cache.getInvocationContext().getOptionOverrides().isBypassInterceptorChain())
         {
  +         try
  +         {
            Node child = getChild(fqn.getLast());
            cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
            return child;
         }
  +         finally
  +         {
  +            cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
  +         }
  +      }
         else
         {
            return cache.getChild(new Fqn(getFqn(), fqn));
  
  
  



More information about the jboss-cvs-commits mailing list