public ClientRegionFactory<K,V> setPoolName(String poolName) { this.attrsFactory.setPoolName(poolName); return this; }
public ClientRegionFactory<K,V> setPoolName(String poolName) { this.attrsFactory.setPoolName(poolName); return this; }
@SuppressWarnings("deprecation") private RegionAttributes<K,V> createRegionAttributes() { RegionAttributes<K,V> ra = this.attrsFactory.create(); if (ra.getPoolName() == null || "".equals(ra.getPoolName())) { UserSpecifiedRegionAttributes<K, V> ura = (UserSpecifiedRegionAttributes<K, V>)ra; if (ura.requiresPoolName) { Pool dp = getDefaultPool(); if (dp != null) { this.attrsFactory.setPoolName(dp.getName()); ra = this.attrsFactory.create(); } else { throw new IllegalStateException("The poolName must be set on a client."); } } } return ra; }
public static void createPool(PoolAttributes poolAttr) throws Exception { Properties props = new Properties(); props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); props.setProperty(DistributionConfig.LOCATORS_NAME, ""); DistributedSystem ds = new CacheServerTestUtil("tmp").getSystem(props);; PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory(); pf.init(poolAttr); PoolImpl p = (PoolImpl)pf.create("CacheServerTestUtil"); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setPoolName(p.getName()); RegionAttributes attrs = factory.create(); pool = p; }
public Object call() throws Exception { Properties props = new Properties(); props.setProperty("mcast-port", "0"); props.setProperty("locators", ""); getSystem(props); Cache cache = getCache(); PoolFactory pf = PoolManager.createFactory(); pf.addServer(getServerHostName(vm0.getHost()), port); pf.create("pool"); AttributesFactory af = new AttributesFactory(); af.setPoolName("pool"); cache.createRegion("testSimplePdx", af.create()); return null; } };
private static void createRegionsInClientCache(String poolName) { AttributesFactory factory = new AttributesFactory(); factory.setPoolName(poolName); factory.setDataPolicy(DataPolicy.EMPTY); RegionAttributes attrs = factory.create(); region = cache.createRegion(PR_NAME, attrs); assertNotNull(region); getLogWriter().info( "Distributed Region " + PR_NAME + " created Successfully :" + region.toString()); }
public static void createClientCache(String host, Integer port1) throws Exception { Properties props = new Properties(); props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); props.setProperty(DistributionConfig.LOCATORS_NAME, ""); new InstantiatorPropogationDUnitTest("temp").createCache(props); Pool p = PoolManager.createFactory().addServer(host, port1.intValue()) .setMinConnections(1).setSubscriptionEnabled(true).setPingInterval(200) .create("ClientServerInstantiatorRegistrationDUnitTestPool"); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setPoolName(p.getName()); Region r = cache.createRegion(REGION_NAME, factory.create()); r.registerInterest("ALL_KEYS"); }
public void testRegionFind() { PoolFactory cpf = PoolManager.createFactory(); ((PoolFactoryImpl)cpf).setStartDisabled(true); Pool pool = cpf.addLocator("localhost", 12345).create("mypool"); Cache cache = CacheFactory.create(ds); AttributesFactory fact = new AttributesFactory(); fact.setPoolName(pool.getName()); Region region = cache.createRegion("myRegion", fact.create()); Assert.assertEquals(pool, PoolManager.find(region)); } public void testClose() {
public static void createProxyRegion(String hostName){ CacheServerTestUtil.disableShufflingOfEndpoints(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setDataPolicy(DataPolicy.EMPTY); factory.setPoolName(pool.getName()); RegionAttributes attrs = factory.create(); metaDataRegion = cache.createRegion(retryRegionName, attrs); assertNotNull(metaDataRegion); }
protected Region createParentRegionOnClient(String name, boolean wanEnable, PoolImpl pool) throws CacheException { final AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setEnableGateway(wanEnable); factory.setPoolName(pool.getName()); factory.addCacheListener(new AtlanticTestCacheListener()); final Region r = createRootRegion(name, factory.create()); return r; } protected Region createParentRegion(String name, boolean wanEnable) throws CacheException {
public static void createProxyRegion(String hostName){ CacheServerTestUtil.disableShufflingOfEndpoints(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setDataPolicy(DataPolicy.EMPTY); factory.setPoolName(pool.getName()); RegionAttributes attrs = factory.create(); metaDataRegion = cache.createRegion(retryRegionName, attrs); assertNotNull(metaDataRegion); }
private static void createPool2(String host, AttributesFactory factory,Integer port) { PoolFactory pf = PoolManager.createFactory(); pf.addServer(host,port.intValue()) .setSubscriptionEnabled(true) .setThreadLocalConnections(true) .setReadTimeout(10000) .setSocketBufferSize(32768) .setPingInterval(1000) .setMinConnections(3) .setSubscriptionRedundancy(-1) ; Pool pool = pf.create("superpoolish" + (poolNameCounter++)); factory.setPoolName(pool.getName()); }
private static void createPool2(String host, AttributesFactory factory,Integer port) { PoolFactory pf = PoolManager.createFactory(); pf.addServer(host,port.intValue()) .setSubscriptionEnabled(true) .setThreadLocalConnections(true) .setReadTimeout(10000) .setSocketBufferSize(32768) .setPingInterval(1000) .setMinConnections(3) .setSubscriptionRedundancy(-1) ; Pool pool = pf.create("superpoolish" + (poolNameCounter++)); factory.setPoolName(pool.getName()); }
public static void createCacheClient(Pool poolAttr, String regionName, Properties dsProperties, Boolean addControlListener) throws Exception { new CacheServerTestUtil("temp").createCache(dsProperties); PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory(); pf.init(poolAttr); PoolImpl p = (PoolImpl)pf.create("CacheServerTestUtil"); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setPoolName(p.getName()); if (addControlListener.booleanValue()) { factory.addCacheListener(new ControlListener()); } RegionAttributes attrs = factory.create(); cache.createRegion(regionName, attrs); pool = p; } public static void createCacheClient(Pool poolAttr, String regionName1,
public Object call() throws Exception { getSystem(getClientProps()); getCache(); PoolFactory pf = PoolManager.createFactory(); pf.addServer(getServerHostName(server.getHost()), serverPort); pf.create("pool1"); AttributesFactory af = new AttributesFactory(); af.setScope(Scope.LOCAL); af.setPoolName("pool1"); createRegion(regionName, af.create()); return null; } });
public void run2() throws CacheException { Properties props = getClientProps(); getSystem(props); PoolFactory pf = PoolManager.createFactory(); pf.addServer(getServerHostName(server.getHost()), port); pf.create("pool1"); AttributesFactory af = new AttributesFactory(); af.setScope(Scope.LOCAL); af.setPoolName("pool1"); Region region = createRootRegion(regionName, af.create()); getCache(); } });
public Object call() throws Exception { getSystem(getClientProps()); getCache(); PoolFactory pf = PoolManager.createFactory(); pf.addServer(getServerHostName(server.getHost()), serverPort); pf.create("pool1"); AttributesFactory af = new AttributesFactory(); af.setScope(Scope.LOCAL); af.setPoolName("pool1"); createRegion(regionName, af.create()); return null; } });
public static void createCacheClient(Pool poolAttr, String regionName1, String regionName2) throws Exception { new CacheServerTestUtil("temp").createCache(getClientProperties()); PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory(); pf.init(poolAttr); PoolImpl p = (PoolImpl)pf.create("CacheServerTestUtil"); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setPoolName(p.getName()); RegionAttributes attrs = factory.create(); cache.createRegion(regionName1, attrs); cache.createRegion(regionName2, attrs); pool = p; }
public Object call() { Cache cache = getCache(); PoolFactory factory = PoolManager.createFactory(); factory.addServer(getServerHostName(host), serverPort); factory.create("pool1"); AttributesFactory af = new AttributesFactory(); af.setDataPolicy(DataPolicy.DEFAULT); af.setScope(Scope.LOCAL); af.setPoolName("pool1"); af.setCacheLoader(new MyCacheLoader("loaded")); RegionAttributes attrs = af.create(); cache.createRegion(regionName, attrs); return null; } });
public Object call() { Cache cache = getCache(); PoolFactory factory = PoolManager.createFactory(); factory.addServer(getServerHostName(host), serverPort); factory.create("pool1"); AttributesFactory af = new AttributesFactory(); af.setDataPolicy(DataPolicy.DEFAULT); af.setScope(Scope.LOCAL); af.setPoolName("pool1"); af.setCacheWriter(new MyCacheWriter()); RegionAttributes attrs = af.create(); cache.createRegion(regionName, attrs); return null; } });