@Override public RestStoreConfigurationBuilder read(RestStoreConfiguration template) { super.read(template); this.connectionPool.read(template.connectionPool()); return this; }
@Override protected void compareStoreConfiguration(String name, StoreConfiguration beforeStore, StoreConfiguration afterStore) { super.compareStoreConfiguration(name, beforeStore, afterStore); RestStoreConfiguration before = (RestStoreConfiguration) beforeStore; RestStoreConfiguration after = (RestStoreConfiguration) afterStore; AssertJUnit.assertEquals("Wrong connection pool for " + name + " configuration.", before.connectionPool(), after.connectionPool()); } }
@Override public void serialize(XMLExtendedStreamWriter writer, RestStoreConfiguration configuration) throws XMLStreamException { writer.writeStartElement(Element.REST_STORE); configuration.attributes().write(writer); writeCommonStoreSubAttributes(writer, configuration); writeServer(writer, configuration); writeConnectionPool(writer, configuration.connectionPool()); writeCommonStoreElements(writer, configuration); writer.writeEndElement(); }
ConnectionPoolConfiguration pool = configuration.connectionPool(); workerGroup = new NioEventLoopGroup(); Bootstrap b = new Bootstrap().group(workerGroup).channel(NioSocketChannel.class);
public void testRemoteCacheStore() throws Exception { cacheManager = TestCacheManagerFactory.fromXml(CACHE_LOADER_CONFIG); List<StoreConfiguration> cacheLoaders = cacheManager.getDefaultCacheConfiguration().persistence().stores(); assertEquals(1, cacheLoaders.size()); RestStoreConfiguration store = (RestStoreConfiguration) cacheLoaders.get(0); assertFalse(store.appendCacheNameToPath()); assertEquals("localhost", store.host()); assertEquals("/rest/___defaultcache/", store.path()); assertEquals(18212, store.port()); assertEquals(15000000, store.maxContentLength()); ConnectionPoolConfiguration connectionPool = store.connectionPool(); assertEquals(10000, connectionPool.connectionTimeout()); assertEquals(10, connectionPool.maxConnectionsPerHost()); assertEquals(10, connectionPool.maxTotalConnections()); assertEquals(20000, connectionPool.bufferSize()); assertEquals(10000, connectionPool.socketTimeout()); assertTrue(connectionPool.tcpNoDelay()); assertFalse(store.async().enabled()); } }