/** * Note this method does not amend the global configuration to reduce overall resource footprint. It is therefore * suggested to use {@link org.infinispan.test.fwk.TestCacheManagerFactory#createClusteredCacheManager(org.infinispan.configuration.cache.ConfigurationBuilder, * TransportFlags)} instead when this is needed * * @param start Whether to start this cache container * @param gc The global configuration builder to use * @param c The default configuration to use * @param keepJmxDomain Whether or not the provided jmx domain should be used or if a unique one is generated * @return The resultant cache manager that is created */ public static EmbeddedCacheManager newDefaultCacheManager(boolean start, GlobalConfigurationBuilder gc, ConfigurationBuilder c, boolean keepJmxDomain) { if (!keepJmxDomain) { gc.globalJmxStatistics().jmxDomain("infinispan-" + UUID.randomUUID()); } return newDefaultCacheManager(start, gc, c); }
public static EmbeddedCacheManager createClusteredCacheManager(boolean start, GlobalConfigurationBuilder gcb, ConfigurationBuilder defaultCacheConfig, TransportFlags flags, boolean keepJmxDomainName) { amendGlobalConfiguration(gcb, flags); amendJTA(defaultCacheConfig); return newDefaultCacheManager(start, gcb, defaultCacheConfig, keepJmxDomainName); }
private static DefaultCacheManager newDefaultCacheManager(boolean start, ConfigurationBuilderHolder holder, boolean keepJmxDomain) { if (!keepJmxDomain) { holder.getGlobalConfigurationBuilder().globalJmxStatistics().jmxDomain( "infinispan-" + UUID.randomUUID()); } return newDefaultCacheManager(start, holder); }
public static EmbeddedCacheManager createCacheManager(GlobalConfigurationBuilder globalBuilder, ConfigurationBuilder builder, boolean keepJmxDomain) { if (globalBuilder.transport().build().transport().transport() != null) { throw new IllegalArgumentException("Use TestCacheManagerFactory.createClusteredCacheManager(...) for clustered cache managers"); } return newDefaultCacheManager(true, globalBuilder, builder, keepJmxDomain); }
public static EmbeddedCacheManager createClusteredCacheManager(GlobalConfigurationBuilder gcb, ConfigurationBuilder defaultCacheConfig, TransportFlags flags, boolean keepJmxDomainName) { amendGlobalConfiguration(gcb, flags); amendJTA(defaultCacheConfig); return newDefaultCacheManager(true, gcb, defaultCacheConfig, keepJmxDomainName); }
public static EmbeddedCacheManager createCacheManager(boolean start) { return newDefaultCacheManager(start, new GlobalConfigurationBuilder().nonClusteredDefault(), new ConfigurationBuilder(), false); }
public static EmbeddedCacheManager createCacheManager(GlobalConfigurationBuilder globalBuilder, ConfigurationBuilder builder) { if (globalBuilder.transport().build().transport().transport() != null) { throw new IllegalArgumentException("Use TestCacheManagerFactory.createClusteredCacheManager(...) for clustered cache managers"); } amendTransport(globalBuilder); return newDefaultCacheManager(true, globalBuilder, builder, false); }
public static EmbeddedCacheManager createClusteredCacheManager(boolean start, ConfigurationBuilderHolder holder, boolean keepJmxDomainName) { TransportFlags flags = new TransportFlags(); amendGlobalConfiguration(holder.getGlobalConfigurationBuilder(), flags); for (ConfigurationBuilder builder : holder.getNamedConfigurationBuilders().values()) amendJTA(builder); return newDefaultCacheManager(start, holder, keepJmxDomainName); }
@Override protected EmbeddedCacheManager addClusterEnabledCacheManager(ConfigurationBuilder builder, TransportFlags flags) { GlobalConfigurationBuilder gc = GlobalConfigurationBuilder.defaultClusteredBuilder(); EmbeddedCacheManager cm = TestCacheManagerFactory.newDefaultCacheManager(true, gc, builder, false); cm.defineConfiguration(DEFAULT_LOCKING_CACHENAME, getLockCacheConfig()); cm.defineConfiguration(DEFAULT_INDEXESMETADATA_CACHENAME, getMetadataCacheConfig()); cm.defineConfiguration(DEFAULT_INDEXESDATA_CACHENAME, getDataCacheConfig()); cacheManagers.add(cm); return cm; }
protected EmbeddedCacheManager addClusterEnabledCacheManager(TransportFlags flags) { GlobalConfigurationBuilder gcb = GlobalConfigurationBuilder.defaultClusteredBuilder(); // Amend first so we can increase the transport thread pool TestCacheManagerFactory.amendGlobalConfiguration(gcb, flags); // we need to increase the transport and remote thread pools to default values BlockingThreadPoolExecutorFactory executorFactory = new BlockingThreadPoolExecutorFactory( 25, 25, 10000, 30000); gcb.transport().transportThreadPool().threadPoolFactory(executorFactory); gcb.transport().remoteCommandThreadPool().threadPoolFactory(executorFactory); EmbeddedCacheManager cm = TestCacheManagerFactory.newDefaultCacheManager(true, gcb, new ConfigurationBuilder(), false); cacheManagers.add(cm); return cm; }
protected EmbeddedCacheManager addClusterEnabledCacheManager(TransportFlags flags) { GlobalConfigurationBuilder gcb = GlobalConfigurationBuilder.defaultClusteredBuilder(); // Amend first so we can increase the transport thread pool TestCacheManagerFactory.amendGlobalConfiguration(gcb, flags); // we need to increase the transport and remote thread pools to default values BlockingThreadPoolExecutorFactory executorFactory = new BlockingThreadPoolExecutorFactory( 25, 25, 10000, 30000); gcb.transport().transportThreadPool().threadPoolFactory(executorFactory); gcb.transport().remoteCommandThreadPool().threadPoolFactory(executorFactory); EmbeddedCacheManager cm = TestCacheManagerFactory.newDefaultCacheManager(true, gcb, new ConfigurationBuilder(), false); cacheManagers.add(cm); return cm; }
protected EmbeddedCacheManager addClusterEnabledCacheManager(TransportFlags flags) { GlobalConfigurationBuilder gcb = GlobalConfigurationBuilder.defaultClusteredBuilder(); // Amend first so we can increase the transport thread pool TestCacheManagerFactory.amendGlobalConfiguration(gcb, flags); // we need to increase the transport and remote thread pools to default values BlockingThreadPoolExecutorFactory executorFactory = new BlockingThreadPoolExecutorFactory( 25, 25, 10000, 30000); gcb.transport().transportThreadPool().threadPoolFactory(executorFactory); gcb.transport().remoteCommandThreadPool().threadPoolFactory(executorFactory); EmbeddedCacheManager cm = TestCacheManagerFactory.newDefaultCacheManager(true, gcb, new ConfigurationBuilder(), false); cacheManagers.add(cm); return cm; }
private EmbeddedCacheManager createCacheManager(int index) { GlobalConfigurationBuilder gcb = new GlobalConfigurationBuilder(); gcb.transport().defaultTransport(); TestCacheManagerFactory.amendGlobalConfiguration(gcb, new TransportFlags().withPortRange(index)); ConfigurationBuilder defaultCacheConfig = new ConfigurationBuilder(); EmbeddedCacheManager cm = TestCacheManagerFactory.newDefaultCacheManager(false, gcb, defaultCacheConfig, false); registerCacheManager(cm); Configuration replCfg = new ConfigurationBuilder().clustering().cacheMode(CacheMode.REPL_SYNC).build(); cm.defineConfiguration(REPL_CACHE_NAME, replCfg); Configuration distCfg = new ConfigurationBuilder().clustering().cacheMode(CacheMode.DIST_SYNC).build(); cm.defineConfiguration(DIST_CACHE_NAME, distCfg); Configuration scatteredCfg = new ConfigurationBuilder().clustering().cacheMode(CacheMode.SCATTERED_SYNC).build(); cm.defineConfiguration(SCATTERED_CACHE_NAME, scatteredCfg); return cm; }