org.infinispan.configuration.cache.Configuration.customInterceptors()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.infinispan.configuration.cache.Configuration.customInterceptors()方法的一些代码示例,展示了Configuration.customInterceptors()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.customInterceptors()方法的具体详情如下:
包路径:org.infinispan.configuration.cache.Configuration
类名称:Configuration
方法名:customInterceptors

Configuration.customInterceptors介绍

暂无

代码示例

代码示例来源:origin: org.infinispan/infinispan-query

private void removeQueryInterceptorFromConfiguration(Configuration cfg) {
 ConfigurationBuilder builder = new ConfigurationBuilder();
 CustomInterceptorsConfigurationBuilder customInterceptorsBuilder = builder.customInterceptors();
 for (InterceptorConfiguration interceptorConfig : cfg.customInterceptors().interceptors()) {
   if (!(interceptorConfig.asyncInterceptor() instanceof QueryInterceptor)) {
    customInterceptorsBuilder.addInterceptor().read(interceptorConfig);
   }
 }
 cfg.customInterceptors().interceptors(builder.build().customInterceptors().interceptors());
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

private void removeQueryInterceptorFromConfiguration(Configuration cfg) {
 ConfigurationBuilder builder = new ConfigurationBuilder();
 CustomInterceptorsConfigurationBuilder customInterceptorsBuilder = builder.customInterceptors();
 for (InterceptorConfiguration interceptorConfig : cfg.customInterceptors().interceptors()) {
   if (!(interceptorConfig.asyncInterceptor() instanceof QueryInterceptor)) {
    customInterceptorsBuilder.addInterceptor().read(interceptorConfig);
   }
 }
 cfg.customInterceptors().interceptors(builder.build().customInterceptors().interceptors());
}

代码示例来源:origin: org.infinispan/infinispan-avro-server

private void removeRemoteIndexingInterceptorFromConfig(Configuration cfg) {
   ConfigurationBuilder builder = new ConfigurationBuilder();
   CustomInterceptorsConfigurationBuilder customInterceptorsBuilder = builder.customInterceptors();

   for (InterceptorConfiguration interceptorConfig : cfg.customInterceptors().interceptors()) {
     if (!(interceptorConfig.interceptor() instanceof RemoteValueWrapperInterceptor)) {
      customInterceptorsBuilder.addInterceptor().read(interceptorConfig);
     }
   }

   cfg.customInterceptors().interceptors(builder.build().customInterceptors().interceptors());
  }
}

代码示例来源:origin: org.infinispan/infinispan-avro-server

private void createRemoteIndexingInterceptor(ComponentRegistry cr, Configuration cfg) {
 BaseTypeConverterInterceptor wrapperInterceptor = cr.getComponent(RemoteValueWrapperInterceptor.class);
 if (wrapperInterceptor == null) {
   wrapperInterceptor = new RemoteValueWrapperInterceptor();
   // Interceptor registration not needed, core configuration handling
   // already does it for all custom interceptors - UNLESS the InterceptorChain already exists in the component registry!
   InterceptorChain ic = cr.getComponent(InterceptorChain.class);
   ConfigurationBuilder builder = new ConfigurationBuilder().read(cfg);
   InterceptorConfigurationBuilder interceptorBuilder = builder.customInterceptors().addInterceptor();
   interceptorBuilder.interceptor(wrapperInterceptor);
   if (ic != null) ic.addInterceptorAfter(wrapperInterceptor, InvocationContextInterceptor.class);
   interceptorBuilder.after(InvocationContextInterceptor.class);
   if (ic != null) {
    cr.registerComponent(wrapperInterceptor, RemoteValueWrapperInterceptor.class);
   }
   cfg.customInterceptors().interceptors(builder.build().customInterceptors().interceptors());
 }
}

代码示例来源:origin: org.infinispan/infinispan-query

cfg.customInterceptors().interceptors(builder.build().customInterceptors().interceptors());

代码示例来源:origin: org.infinispan/infinispan-query

private void assertCacheHasCustomInterceptor(Cache<?, ?> cache, CommandInterceptor interceptor) {
 for (InterceptorConfiguration interceptorConfig : cache.getCacheConfiguration().customInterceptors().interceptors()) {
   if (interceptor == interceptorConfig.interceptor()) {
    return;
   }
 }
 fail("Expected to find interceptor " + interceptor + " among custom interceptors of cache, but it was not there.");
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

private void createQueryInterceptorIfNeeded(ComponentRegistry cr, Configuration cfg, SearchIntegrator searchFactory) {
 QueryInterceptor queryInterceptor = cr.getComponent(QueryInterceptor.class);
 if (queryInterceptor == null) {
   queryInterceptor = buildQueryInterceptor(cfg, searchFactory, cr.getComponent(Cache.class));
   // Interceptor registration not needed, core configuration handling
   // already does it for all custom interceptors - UNLESS the InterceptorChain already exists in the component registry!
   AsyncInterceptorChain ic = cr.getComponent(AsyncInterceptorChain.class);
   ConfigurationBuilder builder = new ConfigurationBuilder().read(cfg);
   InterceptorConfigurationBuilder interceptorBuilder = builder.customInterceptors().addInterceptor();
   interceptorBuilder.interceptor(queryInterceptor);
   boolean txVersioned = Configurations.isTxVersioned(cfg);
   boolean isTotalOrder = cfg.transaction().transactionProtocol().isTotalOrder();
   Class<? extends DDAsyncInterceptor> wrappingInterceptor = EntryWrappingInterceptor.class;
   if (txVersioned) {
    wrappingInterceptor = isTotalOrder ?
       TotalOrderVersionedEntryWrappingInterceptor.class : VersionedEntryWrappingInterceptor.class;
   }
   if (ic != null) ic.addInterceptorAfter(queryInterceptor, wrappingInterceptor);
   interceptorBuilder.after(wrappingInterceptor);
   if (ic != null) {
    cr.registerComponent(queryInterceptor, QueryInterceptor.class);
    cr.registerComponent(queryInterceptor, queryInterceptor.getClass().getName(), true);
   }
   cfg.customInterceptors().interceptors(builder.build().customInterceptors().interceptors());
 }
}

代码示例来源:origin: org.infinispan/infinispan-core

assertTrue(!c.customInterceptors().interceptors().isEmpty());
assertEquals(6, c.customInterceptors().interceptors().size());
for(InterceptorConfiguration i : c.customInterceptors().interceptors()) {
  if (i.asyncInterceptor() instanceof FooInterceptor) {
   assertEquals(i.properties().getProperty("foo"), "bar");

代码示例来源:origin: org.infinispan/infinispan-core

List<InterceptorConfiguration> interceptors = c.customInterceptors().interceptors();
InterceptorConfiguration interceptor = interceptors.get(0);
assertTrue(interceptor.interceptor() instanceof CustomInterceptor1);

相关文章