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

Manik Surtani msurtani at jboss.com
Wed Jan 3 10:33:10 EST 2007


  User: msurtani
  Date: 07/01/03 10:33:10

  Modified:    src/org/jboss/cache/factories  InterceptorChainFactory.java
  Log:
  Improved notification mechanism, added a notification interceptor
  
  Revision  Changes    Path
  1.37      +12 -48    JBossCache/src/org/jboss/cache/factories/InterceptorChainFactory.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: InterceptorChainFactory.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/factories/InterceptorChainFactory.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -b -r1.36 -r1.37
  --- InterceptorChainFactory.java	30 Dec 2006 19:48:47 -0000	1.36
  +++ InterceptorChainFactory.java	3 Jan 2007 15:33:10 -0000	1.37
  @@ -75,54 +75,6 @@
         first.setNext(i);
      }
   
  -   /**
  -    * Assembles the interceptor stack. Presence and order of interceptors is determined by looking at
  -    * the cache configuration. In the future, this will be accessible through XML. See refactoring.txt for
  -    * details. An alternative might be to use a simple rools engine to assemble the stack.
  -    * Creates either:
  -    * <pre>
  -    * <p/>
  -    * CallInterceptor
  -    * [EvictionInterceptor]
  -    * PessimisticLockInterceptor
  -    * [CacheLoaderInterceptor]
  -    * [ReplicationInterceptor]
  -    * [CacheStoreInterceptor]
  -    * <p/>
  -    * or
  -    * <p/>
  -    * CallInterceptor
  -    * [EvictionInterceptor]
  -    * PessimisticLockInterceptor
  -    * [CacheStoreInterceptor]
  -    * [CacheLoaderInterceptor]
  -    * [ReplicationInterceptor]
  -    * <p/>
  -    * </pre>
  -    * <p/>
  -    * If cache passivation is turned on the interceptor stack will be assembled as follow:
  -    * <pre>
  -    * <p/>
  -    * CallInterceptor
  -    * [EvictionInterceptor]
  -    * PessimisticLockInterceptor
  -    * [ActivationInterceptor]
  -    * [ReplicationInterceptor]
  -    * [PassivationInterceptor]
  -    * <p/>
  -    * or
  -    * <p/>
  -    * CallInterceptor
  -    * [EvictionInterceptor]
  -    * PessimisticLockInterceptor
  -    * [PassivationInterceptor]
  -    * [ActivationInterceptor]
  -    * [ReplicationInterceptor]
  -    * <p/>
  -    * </pre>
  -    * <p/>
  -    * CallInterceptor is always present at the top, the others may or may not be present
  -    */
      private Interceptor createPessimisticInterceptorChain(CacheImpl cache) throws IllegalAccessException, InstantiationException, ClassNotFoundException
      {
         Interceptor call_interceptor;
  @@ -138,6 +90,7 @@
         Interceptor eviction_interceptor;
         Interceptor dataGravitatorInterceptor = null;
         Interceptor invocationCtxInterceptor = createInterceptor(InvocationContextInterceptor.class, cache);
  +      Interceptor notificationInterceptor = createInterceptor(NotificationInterceptor.class, cache);
         Interceptor first = null;
   
   
  @@ -213,6 +166,11 @@
            addInterceptor(first, txInterceptor);
         }
   
  +      if (first == null)
  +         first = notificationInterceptor;
  +      else
  +         addInterceptor(first, notificationInterceptor);
  +
         // create the stack from the bottom up
         if (activation_interceptor != null)
         {
  @@ -394,6 +352,7 @@
         Interceptor passivationInterceptor = null, cacheLoaderInterceptor = null, cacheStoreInterceptor = null, first = null;
         Interceptor cacheMgmtInterceptor, evictionInterceptor = null, dataGravitatorInterceptor = null;
         Interceptor invocationCtxInterceptor = createInterceptor(InvocationContextInterceptor.class, cache);
  +      Interceptor notificationInterceptor = createInterceptor(NotificationInterceptor.class, cache);
   
         CacheLoaderManager cacheLoaderManager = cache.getCacheLoaderManager();
         if (cacheLoaderManager != null && cacheLoaderManager.getCacheLoader() != null)
  @@ -475,6 +434,11 @@
         }
   
         if (first == null)
  +         first = notificationInterceptor;
  +      else
  +         addInterceptor(first, notificationInterceptor);
  +
  +      if (first == null)
         {
            first = replicationInterceptor;
         }
  
  
  



More information about the jboss-cvs-commits mailing list