/** * @since GemFire 5.7 */ private void endPool() { PoolFactory f = (PoolFactory) stack.pop(); String name = (String) stack.pop(); f.create(name); }
count++; pool = defaultPoolFactory.create(poolName);
poolFactory.setSubscriptionAckInterval(subscriptionAckInterval); p = (PoolImpl) poolFactory.create("ClientServerMiscDUnitTestPool");
void createClientCacheAndVerifyPingIntervalIsSet(String host, int port) throws Exception { PoolImpl pool = null; try { Properties props = new Properties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, ""); createCache(props); pool = (PoolImpl) PoolManager.createFactory().addServer(host, port) .setSubscriptionEnabled(true).setThreadLocalConnections(false).setReadTimeout(1000) .setSocketBufferSize(32768).setMinConnections(1).setSubscriptionRedundancy(-1) .setPingInterval(2000).create("test pool"); Region<Object, Object> region = cache.createRegionFactory(RegionShortcut.LOCAL) .setPoolName("test pool").create(REGION_NAME1); region.registerInterest(".*"); /** get the subscription connection and verify that it has the correct timeout setting */ QueueConnectionImpl primaryConnection = (QueueConnectionImpl) pool.getPrimaryConnection(); int pingInterval = ((CacheClientUpdater) primaryConnection.getUpdater()) .getServerQueueStatus().getPingInterval(); assertNotEquals(0, pingInterval); assertEquals(CacheClientNotifier.getClientPingInterval(), pingInterval); } finally { cache.close(); } }
.setSubscriptionRedundancy(-1) .create("testBug35380Pool");
.setSubscriptionRedundancy(-1) .create("testProxyCreationBeforeCacheCreationPool");
.create("testInvalidatesPropagateOnRegionHavingNoPool");
rpoolName = poolName; Pool pool = pf.create(rpoolName); if (factory != null) { factory.setPoolName(rpoolName);
/** * Creates a {@link Pool} with the given {@link String name} using the provided {@link PoolFactory}. * * @param poolFactory {@link PoolFactory} used to create the {@link Pool}. * @param poolName {@link String name} of the new {@link Pool}. * @return a new instance of {@link Pool} with the given {@link String name}. * @see org.apache.geode.cache.client.PoolFactory#create(String) * @see org.apache.geode.cache.client.Pool */ protected Pool create(PoolFactory poolFactory, String poolName) { return poolFactory.create(poolName); }
/** * Creates a {@link Pool} with the given {@link String name} using the provided {@link PoolFactory}. * * @param poolFactory {@link PoolFactory} used to create the {@link Pool}. * @param poolName {@link String name} of the new {@link Pool}. * @return a new instance of {@link Pool} with the given {@link String name}. * @see org.apache.geode.cache.client.PoolFactory#create(String) * @see org.apache.geode.cache.client.Pool */ protected Pool create(PoolFactory poolFactory, String poolName) { return poolFactory.create(poolName); }
.thenAnswer(newSetter(threadLocalConnections, mockPoolFactory)); when(mockPoolFactory.create(anyString())).thenAnswer(invocation -> {
defaultPool.set(mockPoolFactory.create("DEFAULT"));
public static void main(String[] args) { // connect to the locator using default port 10334 ClientCache cache = new ClientCacheFactory().set("log-level", "WARN").create(); final String poolName = "subscriptionPool"; PoolManager.createFactory().addLocator("127.0.0.1", 10334).setSubscriptionEnabled(true) .create(poolName); // create a local region that matches the server region final ClientRegionFactory<Integer, String> incomingRegionFactory = cache.<Integer, String>createClientRegionFactory(ClientRegionShortcut.PROXY); Region<Integer, String> incomingRegion = incomingRegionFactory.setPoolName(poolName).create(INCOMING_REGION_NAME); // create another local region that matches the server region final ClientRegionFactory<String, String> outgoingRegionFactory = cache.<String, String>createClientRegionFactory(ClientRegionShortcut.PROXY); Region<String, String> outgoingRegion = outgoingRegionFactory.setPoolName(poolName).create(OUTGOING_REGION_NAME); new Example().checkWords(incomingRegion, outgoingRegion, Arrays.asList(new String[] {"that", "teh", "wil", "i'"})); cache.close(); }