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

Ben Wang bwang at jboss.com
Wed Nov 8 03:47:20 EST 2006


  User: bwang   
  Date: 06/11/08 03:47:20

  Modified:    src-50/org/jboss/cache/pojo/interceptors 
                        PojoBeginInterceptor.java
  Log:
  1. JBCACHE-839 to allow replicating final field.
  2. JBCACHE-619 to support Enum.
  
  Revision  Changes    Path
  1.2       +21 -1     JBossCache/src-50/org/jboss/cache/pojo/interceptors/PojoBeginInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PojoBeginInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/interceptors/PojoBeginInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- PojoBeginInterceptor.java	6 Jul 2006 02:42:35 -0000	1.1
  +++ PojoBeginInterceptor.java	8 Nov 2006 08:47:19 -0000	1.2
  @@ -15,10 +15,29 @@
   /** The first interceptor that deals initialization.
    *
    * @author Ben Wang
  - * @version $Id: PojoBeginInterceptor.java,v 1.1 2006/07/06 02:42:35 bwang Exp $
  + * @version $Id: PojoBeginInterceptor.java,v 1.2 2006/11/08 08:47:19 bwang Exp $
    */
   public class PojoBeginInterceptor extends AbstractInterceptor
   {
  +   private static ThreadLocal REPLICATE_FINAL = new ThreadLocal() ;
  +
  +   public void setReplicateFinalField(String isTrue)
  +   {
  +      REPLICATE_FINAL.set(Boolean.valueOf(isTrue));   
  +   }
  +
  +   private static void reset()
  +   {
  +      REPLICATE_FINAL.set(Boolean.FALSE);
  +   }
  +
  +   public static boolean getReplicateFinalField()
  +   {
  +      if(REPLICATE_FINAL.get() == null) return false;
  +
  +      return (Boolean)REPLICATE_FINAL.get();
  +   }
  +
      public Object invoke(Invocation in) throws Throwable
      {
         if(!(in instanceof MethodInvocation))
  @@ -34,6 +53,7 @@
            log.debug("**** Entering method: **** " + invocation.getMethod());
            return invocation.invokeNext(); // proceed to next advice or actual call
         } finally {
  +//         reset(); // reset
            log.debug("Leaving method: " + invocation.getMethod());
         }
      }
  
  
  



More information about the jboss-cvs-commits mailing list