builder.classLoader(module.getClassLoader()); int id = Ids.MAX_ID; SerializationConfigurationBuilder serialization = builder.serialization();
private void fixClassLoaders(ConfigurationBuilderHolder builderHolder) { //Global section: builderHolder.getGlobalConfigurationBuilder().classLoader( ispnClassLoadr ); } }
private void fixClassLoaders(ConfigurationBuilderHolder builderHolder) { //Global section: builderHolder.getGlobalConfigurationBuilder().classLoader( ispnClassLoadr ); } }
private void fixClassLoaders(ConfigurationBuilderHolder builderHolder) { //Global section: builderHolder.getGlobalConfigurationBuilder().classLoader(ispnClassLoadr); }
private static ConfigurationBuilderHolder parse(InputStream input, ClassLoader classLoader) { ParserRegistry parser = new ParserRegistry(classLoader); // Infinispan requires the context ClassLoader to have full visibility on all // its components and eventual extension points even *during* configuration parsing. Thread currentThread = Thread.currentThread(); ClassLoader originalClassLoader = currentThread.getContextClassLoader(); try { currentThread.setContextClassLoader(classLoader); ConfigurationBuilderHolder builderHolder = parser.parse(input); // Workaround Infinispan's ClassLoader strategies to bend to our will: builderHolder.getGlobalConfigurationBuilder().classLoader(classLoader); return builderHolder; } finally { currentThread.setContextClassLoader(originalClassLoader); } } }
private GlobalConfiguration getGlobalConfiguration() { GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder(); return builder.read(getWebCacheManager().getCacheManagerConfiguration()) .classLoader(Thread.currentThread().getContextClassLoader()) .transport().clusterName("wboss") .build(); } }
/** * Build a local cache configuration. * <p/> * In local cache mode, the cache is not shared among the servers in a cluster. Each machine keeps a local cache. * This allows quick startups and eliminates network traffic in the cluster, but subsequent requests to different * cluster members cannot benefit from the cached data. */ protected void buildLocalConfiguration() { GlobalConfiguration globalConfiguration = new GlobalConfigurationBuilder() .classLoader(InfinispanEmbeddedCacheManager.class.getClassLoader()) .globalJmxStatistics() .jmxDomain("org.apache.marmotta.kiwi") .allowDuplicateDomains(true) .build(); defaultConfiguration = new ConfigurationBuilder() .clustering() .cacheMode(CacheMode.LOCAL) .eviction() .strategy(EvictionStrategy.LIRS) .maxEntries(100000) .expiration() .lifespan(5, TimeUnit.MINUTES) .maxIdle(1, TimeUnit.MINUTES) .build(); cacheManager = new DefaultCacheManager(globalConfiguration, defaultConfiguration, true); log.info("initialised Infinispan local cache manager"); }
builder.classLoader(new MergedClassLoader(new ClassLoader[] { componentClassLoader, JGroupsTransport.class.getClassLoader() }));
/** * Create a non-clustered instance of the infinispan cache. */ public LDCachingInfinispanBackend() { globalConfiguration = new GlobalConfigurationBuilder() .classLoader(LDCachingInfinispanBackend.class.getClassLoader()) .globalJmxStatistics() .jmxDomain("org.apache.marmotta.ldcache") .allowDuplicateDomains(true) .build(); defaultConfiguration = new ConfigurationBuilder() .clustering() .cacheMode(CacheMode.LOCAL) .eviction() .strategy(EvictionStrategy.LIRS) .maxEntries(100000) .expiration() .lifespan(7, TimeUnit.DAYS) .maxIdle(1, TimeUnit.DAYS) .build(); clustered = false; }
.classLoader(InfinispanEmbeddedCacheManager.class.getClassLoader()) .transport() .defaultTransport()
.classLoader(InfinispanEmbeddedCacheManager.class.getClassLoader()) .transport() .defaultTransport()
.classLoader(LDCachingInfinispanBackend.class.getClassLoader()) .transport() .defaultTransport() .classLoader(LDCachingInfinispanBackend.class.getClassLoader()) .transport() .defaultTransport()
builder.classLoader(module.getClassLoader()); int id = Ids.MAX_ID; SerializationConfigurationBuilder serialization = builder.serialization();
try { loader = makeGlobalClassLoader(moduleLoader, module, modules); builder.classLoader(loader); int id = Ids.MAX_ID; for (SimpleExternalizer<?> externalizer: ServiceLoader.load(SimpleExternalizer.class, loader)) {