Package org.jboss.cache.config

Examples of org.jboss.cache.config.CustomInterceptorConfig


   }

   public void testAddLast()
   {
      AaaCustomInterceptor interceptor = new AaaCustomInterceptor();
      CustomInterceptorConfig config = new CustomInterceptorConfig(interceptor);
      config.setLast(true);
      buildCache(config);
      List chain = cache.getInterceptorChain();
      assert chain.get(chain.size() - 1).equals(interceptor);
      assert cache.getInterceptorChain().size() == defaultInterceptroCount + 1;
   }
View Full Code Here


   }

   public void testAddAfter()
   {
      AaaCustomInterceptor interceptor = new AaaCustomInterceptor();
      CustomInterceptorConfig config = new CustomInterceptorConfig(interceptor);
      config.setAfterClass(MVCCLockingInterceptor.class.getName());
      buildCache(config);
      List<CommandInterceptor> chain = cache.getInterceptorChain();
      int occurenceCount = 0;
      for (CommandInterceptor ci : chain)
      {
View Full Code Here

   }

   public void testAddBefore()
   {
      AaaCustomInterceptor interceptor = new AaaCustomInterceptor();
      CustomInterceptorConfig config = new CustomInterceptorConfig(interceptor);
      config.setBeforeClass(MVCCLockingInterceptor.class.getName());
      buildCache(config);
      List<CommandInterceptor> chain = cache.getInterceptorChain();
      int occurenceCount = 0;
      for (CommandInterceptor ci : chain)
      {
View Full Code Here

   @Test(enabled = true)
   public void testAddAtIndex()
   {
      AaaCustomInterceptor interceptor = new AaaCustomInterceptor();
      CustomInterceptorConfig config = new CustomInterceptorConfig(interceptor);
      config.setIndex(1);
      buildCache(config);
      List<CommandInterceptor> chain = cache.getInterceptorChain();
      assert chain.get(1).equals(interceptor);
      assert cache.getInterceptorChain().size() == defaultInterceptroCount + 1;
   }
View Full Code Here

   }

   public void testAddAtInvalidIndex()
   {
      AaaCustomInterceptor interceptor = new AaaCustomInterceptor();
      CustomInterceptorConfig config = new CustomInterceptorConfig(interceptor);
      config.setIndex(1000);
      try
      {
         buildCache(config);
         assert false : "exception expected here";
      }
View Full Code Here

               "                   class=\"org.jboss.cache.config.parsing.custominterceptors.AaaCustomInterceptor\"/>\n" +
               "   </customInterceptors>";
      Element element = XmlConfigHelper.stringToElementInCoreNS(xml);
      List<CustomInterceptorConfig> configs = parser.parseCustomInterceptors(element);
      assert configs.size() == 5;
      CustomInterceptorConfig one = configs.get(0);
      assert one.isFirst();
      assert one.getInterceptor() instanceof AaaCustomInterceptor;
      assert ((AaaCustomInterceptor)one.getInterceptor()).getAttrOne().equals("value1");
      assert ((AaaCustomInterceptor)one.getInterceptor()).getAttrTwo().equals("value2");
      assert ((AaaCustomInterceptor)one.getInterceptor()).getAttrThree().equals("value3");

      CustomInterceptorConfig two = configs.get(1);
      assert !two.isFirst();
      assert two.isLast();
      assert two.getInterceptor() instanceof BbbCustomInterceptor;

      CustomInterceptorConfig three = configs.get(2);
      assert !three.isFirst();
      assert !three.isLast();
      assert three.getIndex() == 3;

      CustomInterceptorConfig four = configs.get(3);
      assert !four.isFirst();
      assert !four.isLast();
      assert four.getBeforeClass().equals("org.jboss.cache.interceptors.CallInterceptor");

      CustomInterceptorConfig five = configs.get(4);
      assert !five.isFirst();
      assert !five.isLast();
      assert five.getAfterClass().equals("org.jboss.cache.interceptors.CallInterceptor");
   }
View Full Code Here

         after = getAttributeValue(interceptorElement, "after");
         if (!existsAttribute(after)) after = null;

         CommandInterceptor interceptor = buildCommandInterceptor(interceptorElement);

         CustomInterceptorConfig customInterceptorConfig = new CustomInterceptorConfig(interceptor, first, last, index, after, before);
         interceptorConfigs.add(customInterceptorConfig);
      }
      return interceptorConfigs;
   }
View Full Code Here

TOP

Related Classes of org.jboss.cache.config.CustomInterceptorConfig

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.