public static EmbeddedCacheManager fromStream(InputStream is, boolean keepJmxDomainName, boolean defaultParsersOnly, boolean start) throws IOException { ParserRegistry parserRegistry = new ParserRegistry(Thread.currentThread().getContextClassLoader(), defaultParsersOnly); ConfigurationBuilderHolder holder = parserRegistry.parse(is); // The node name is set in each DefaultThreadFactory individually, override it here String testShortName = TestResourceTracker.getCurrentTestShortName(); GlobalConfiguration gc = holder.getGlobalConfigurationBuilder().build(); updateNodeName(testShortName, gc.listenerThreadPool()); updateNodeName(testShortName, gc.expirationThreadPool()); updateNodeName(testShortName, gc.persistenceThreadPool()); updateNodeName(testShortName, gc.stateTransferThreadPool()); updateNodeName(testShortName, gc.asyncThreadPool()); updateNodeName(testShortName, gc.transport().transportThreadPool()); return createClusteredCacheManager(start, holder, keepJmxDomainName); }
public void testGlobalConfig() throws Exception { ConfigurationBuilderHolder holder = parse(); GlobalConfiguration gc = holder.getGlobalConfigurationBuilder().build(); BlockingThreadPoolExecutorFactory listenerThreadPool = gc.listenerThreadPool().threadPoolFactory(); assertEquals(2, listenerThreadPool.maxThreads()); BlockingThreadPoolExecutorFactory persistenceThreadPool = gc.persistenceThreadPool().threadPoolFactory(); assertEquals(4, persistenceThreadPool.maxThreads()); Properties transportProps = gc.transport().properties(); assertEquals("jgroups-tcp.xml", transportProps.get("configurationFile")); Configuration configuration = holder.getDefaultConfigurationBuilder().build(); assertEquals(IsolationLevel.READ_COMMITTED, configuration.locking().isolationLevel()); } }
gc.listenerThreadPool().threadPoolFactory(); assertEquals(5, listenerThreadPool.maxThreads()); assertEquals(10000, listenerThreadPool.queueLength()); DefaultThreadFactory listenerThreadFactory = gc.listenerThreadPool().threadFactory(); assertEquals("AsyncListenerThread", listenerThreadFactory.threadNamePattern());
BlockingThreadPoolExecutorFactory threadPool; threadFactory = getGlobalConfiguration(holder).listenerThreadPool().threadFactory(); assertEquals("infinispan", threadFactory.threadGroup().getName()); assertEquals("%G %i", threadFactory.threadNamePattern()); assertEquals(5, threadFactory.initialPriority()); threadPool = getGlobalConfiguration(holder).listenerThreadPool().threadPoolFactory(); assertEquals(1, threadPool.coreThreads()); assertEquals(1, threadPool.maxThreads());