Examples of CustomInterceptorConfig


Examples of org.infinispan.config.CustomInterceptorConfig

   protected RemoteCache remoteCache;

   @Override
   protected EmbeddedCacheManager createCacheManager() throws Exception {
      ConfigurationBuilder builder = new ConfigurationBuilder();
      CustomInterceptorConfig cic = new CustomInterceptorConfig(
            new TimeoutInducingInterceptor(), false, false, -1,
            EntryWrappingInterceptor.class.getName(), "");
      builder.customInterceptors().addInterceptor().interceptor(cic.getInterceptor());
      return TestCacheManagerFactory.createCacheManager(builder);
   }
View Full Code Here

Examples of org.infinispan.config.CustomInterceptorConfig

         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

Examples of org.infinispan.config.CustomInterceptorConfig

         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

Examples of org.infinispan.config.CustomInterceptorConfig

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

         CommandInterceptor interceptor = buildCommandInterceptor(interceptorElement);
         CustomInterceptorConfig customInterceptorConfig = new CustomInterceptorConfig(interceptor,
                  first, last, index, after, before);
         interceptorConfigs.add(customInterceptorConfig);
      }
      ((Configuration) bean).setCustomInterceptors(interceptorConfigs);
   }
View Full Code Here

Examples of org.infinispan.config.CustomInterceptorConfig

      // we also need a custom interceptor to intercept get() calls after the CLI, to slow it down so an evict goes
      // through first

      sdi = new SlowDownInterceptor();
      CustomInterceptorConfig cic = new CustomInterceptorConfig(sdi);
      cic.setAfterInterceptor(CacheLoaderInterceptor.class);
      config.setCustomInterceptors(Collections.singletonList(cic));
      return TestCacheManagerFactory.createCacheManager(config);
   }
View Full Code Here

Examples of org.infinispan.config.CustomInterceptorConfig

                  expectedIndexLocalOnly, configuration.indexing().indexLocalOnly());
   }

   public final void configurationOverridesShouldOverrideCustomInterceptorsPropIfExplicitlySet()
         throws Exception {
      final CustomInterceptorConfig customInterceptor = new CustomInterceptorConfig();
      final List<CustomInterceptorConfig> expectedCustomInterceptors = Arrays
            .asList(customInterceptor);

      final ConfigurationOverrides objectUnderTest = new ConfigurationOverrides();
      objectUnderTest.setCustomInterceptors(expectedCustomInterceptors);
View Full Code Here

Examples of org.jboss.cache.config.CustomInterceptorConfig

         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

Examples of org.jboss.cache.config.CustomInterceptorConfig

               "                   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

Examples of org.jboss.cache.config.CustomInterceptorConfig

         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

Examples of org.jboss.cache.config.CustomInterceptorConfig

   }

   public void testAddFirst()
   {
      AaaCustomInterceptor interceptor = new AaaCustomInterceptor();
      CustomInterceptorConfig config = new CustomInterceptorConfig(interceptor);
      config.setFirst(true);
      buildCache(config);
      assert cache.getInterceptorChain().get(0).equals(interceptor);
      assert cache.getInterceptorChain().size() == defaultInterceptroCount + 1;
   }
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.