Examples of InterceptorChainFactory


Examples of org.jboss.cache.factories.InterceptorChainFactory

      TreeCache cache = new TreeCache();
      cache.setUseInterceptorMbeans(false);
      cache.setNodeLockingOptimistic(true);
      cache.setCacheLoaderConfiguration(getCacheLoaderConfig(false, false));
      cache.createService();
      Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);

      // test the chain size.
      List chainAsList = InterceptorChainFactory.asList(next);
      Assert.assertEquals(8, chainAsList.size());
View Full Code Here

Examples of org.jboss.cache.factories.InterceptorChainFactory

      TreeCache cache = new TreeCache();
      cache.setUseInterceptorMbeans(false);
      cache.setNodeLockingOptimistic(true);
      cache.setCacheLoaderConfiguration(getCacheLoaderConfig(true, false));
      cache.createService();
      Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);

      // test the chain size.
      List chainAsList = InterceptorChainFactory.asList(next);
      Assert.assertEquals(8, chainAsList.size());
View Full Code Here

Examples of org.jboss.cache.factories.InterceptorChainFactory

   {
      TreeCache cache = new TreeCache();
      cache.setUseInterceptorMbeans(false);
      cache.setCacheMode(TreeCache.REPL_ASYNC);

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

      // test the chain size.
      List chainAsList = InterceptorChainFactory.asList(chain);
      Assert.assertEquals(5, chainAsList.size());

      Assert.assertEquals(TxInterceptor.class, chain.getClass());
      chain = chain.getNext();
      Assert.assertEquals(ReplicationInterceptor.class, chain.getClass());
      chain = chain.getNext();
      Assert.assertEquals(UnlockInterceptor.class, chain.getClass());
      chain = chain.getNext();
      Assert.assertEquals(PessimisticLockInterceptor.class, chain.getClass());
      chain = chain.getNext();
      Assert.assertEquals(CallInterceptor.class, chain.getClass());

      // ok, my replication chain looks good.

      // now for my invalidation chain.
      cache = new TreeCache();
      cache.setUseInterceptorMbeans(false);
      cache.setCacheMode(TreeCache.INVALIDATION_ASYNC);
      chain = new InterceptorChainFactory().buildInterceptorChain(cache);

      // test the chain size.
      chainAsList = InterceptorChainFactory.asList(chain);
      Assert.assertEquals(5, chainAsList.size());
View Full Code Here

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

Examples of org.jboss.cache.factories.InterceptorChainFactory

   }

   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

Examples of org.jboss.cache.factories.InterceptorChainFactory

      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

Examples of org.jboss.cache.factories.InterceptorChainFactory

      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

Examples of org.jboss.cache.factories.InterceptorChainFactory

      }

      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

Examples of org.jboss.cache.factories.InterceptorChainFactory

   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

Examples of org.jboss.cache.factories.InterceptorChainFactory

      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
TOP
Copyright © 2018 www.massapi.com. 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.