Package org.jboss.cache.factories

Examples of org.jboss.cache.factories.InterceptorChainFactory


   }

   public void testCacheMgmtConfig() throws Exception
   {
      cache.setUseInterceptorMbeans(true);
      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
      List list = InterceptorChainFactory.asList(chain);
      System.out.println("testCacheMgmtConfig interceptors are:\n" + list);
      assertNotNull(list);
      assertEquals(5, list.size());
      assertEquals(list.get(0).getClass(), CacheMgmtInterceptor.class);
View Full Code Here


   }

   public void testEvictionInterceptorConfig() throws Exception
   {
      cache.setIsUsingEviction(true);
      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
      List list = InterceptorChainFactory.asList(chain);
      System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
      assertNotNull(list);
      assertEquals(6, list.size());
      assertEquals(list.get(0).getClass(), CacheMgmtInterceptor.class);
View Full Code Here

      xmlString += "</config>";
      cache.setCacheMode("REPL_SYNC");
      cache.setBuddyReplicationConfig(XmlHelper.stringToElement(xmlString));
      cache.setNodeLockingScheme("OPTIMISTIC");

      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);

      List list = InterceptorChainFactory.asList(chain);
      System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
      assertNotNull(list);
      assertEquals(9, list.size());
View Full Code Here

      xmlString += "<buddyPoolName>buddyPoolName</buddyPoolName>";
      xmlString += "</config>";
      cache.setCacheMode("REPL_SYNC");
      cache.setBuddyReplicationConfig(XmlHelper.stringToElement(xmlString));

      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);

      List list = InterceptorChainFactory.asList(chain);
      System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
      assertNotNull(list);
      assertEquals(7, list.size());
View Full Code Here

      }

      createEvictionPolicy();

      // build interceptor chain
      interceptor_chain = new InterceptorChainFactory().buildInterceptorChain(this);
      // register interceptor mbeans
      isStandalone = (this.getServiceName() == null);
      if (use_interceptor_mbeans)
      {
         MBeanServer mbserver = getMBeanServer();
View Full Code Here

   public synchronized void addInterceptor(Interceptor i, int position)
   {
      List<Interceptor> interceptors = getInterceptors();

      InterceptorChainFactory factory = componentRegistry.getComponent(InterceptorChainFactory.class);

      interceptors.add(position, i);

      // now correct the chaining of interceptors...
      Interceptor linkedChain = factory.correctInterceptorChaining(interceptors);

      setInterceptorChain(linkedChain);
   }
View Full Code Here

      setInterceptorChain(linkedChain);
   }

   public synchronized void removeInterceptor(int position)
   {
      InterceptorChainFactory factory = componentRegistry.getComponent(InterceptorChainFactory.class);
      List<Interceptor> i = getInterceptors();
      i.remove(position);
      setInterceptorChain(factory.correctInterceptorChaining(i));
   }
View Full Code Here

      setInterceptorChain(factory.correctInterceptorChaining(i));
   }

   public synchronized void removeInterceptor(Class<? extends Interceptor> interceptorType)
   {
      InterceptorChainFactory factory = componentRegistry.getComponent(InterceptorChainFactory.class);
      List<Interceptor> interceptors = getInterceptors();
      int position = -1;
      boolean found = false;
      for (Interceptor interceptor : interceptors)
      {
         position++;
         if (interceptor.getClass().equals(interceptorType))
         {
            found = true;
            break;
         }
      }

      if (found)
      {
         interceptors.remove(position);
         setInterceptorChain(factory.correctInterceptorChaining(interceptors));
      }
   }
View Full Code Here

      }
   }

   public synchronized void addInterceptor(Interceptor i, Class<? extends Interceptor> afterInterceptor)
   {
      InterceptorChainFactory factory = componentRegistry.getComponent(InterceptorChainFactory.class);
      List<Interceptor> interceptors = getInterceptors();
      int position = -1;
      boolean found = false;
      for (Interceptor interceptor : interceptors)
      {
         position++;
         if (interceptor.getClass().equals(afterInterceptor))
         {
            found = true;
            break;
         }
      }

      if (found)
      {
         componentRegistry.registerComponent(i, Interceptor.class);
         interceptors.add(++position, i);
         setInterceptorChain(factory.correctInterceptorChaining(interceptors));
         componentRegistry.start();
         // make sure I start the last 2 "manually startable" components
         startManualComponents();
      }
   }
View Full Code Here

      }

      createEvictionPolicy();

      // build interceptor chain
      interceptor_chain = new InterceptorChainFactory().buildInterceptorChain(this);
      // register interceptor mbeans
      isStandalone = (this.getServiceName() == null);
      if (use_interceptor_mbeans)
      {
         MBeanServer mbserver = getMBeanServer();
View Full Code Here

TOP

Related Classes of org.jboss.cache.factories.InterceptorChainFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.