/** * Constructs a RegionFactory by creating a DistributedSystem and a Cache. If no DistributedSystem * exists it creates a DistributedSystem with default configuration, otherwise it uses the * existing DistributedSystem. The default Region configuration is used. * * @throws CacheException if unable to connect the DistributedSystem or create a Cache * @deprecated as of 6.5 use {@link Cache#createRegionFactory()} instead. */ @Deprecated public RegionFactory() throws CacheWriterException, RegionExistsException, TimeoutException { this((InternalCache) new CacheFactory().create()); }
/** * Constructs a RegionFactory by creating a DistributedSystem and a Cache. If no DistributedSystem * exists it creates a DistributedSystem with default configuration, otherwise it uses the * existing DistributedSystem. The Region configuration is initialized using the provided * RegionAttributes. * * @throws CacheException if unable to connect the DistributedSystem or create a Cache * @deprecated as of 6.5 use {@link Cache#createRegionFactory(RegionAttributes)} instead. */ @Deprecated public RegionFactory(RegionAttributes<K, V> regionAttributes) throws CacheWriterException, RegionExistsException, TimeoutException { this((InternalCache) new CacheFactory().create(), regionAttributes); }
public void createCache(Properties prop) { if (null != prop && !prop.isEmpty()) { cache = new CacheFactory(prop).create(); } else { cache = new CacheFactory().set(MCAST_PORT, "0").create(); } }
public void createCache(final Properties config, final Properties systemProperties) { System.getProperties().putAll(systemProperties); cache = (InternalCache) new CacheFactory(config(config)).create(); }
public void createCache() { cache = (InternalCache) new CacheFactory(config()).create(); }
public void createCache(final Properties config) { cache = (InternalCache) new CacheFactory(config(config)).create(); }
protected CacheFactory getCacheFactory() { CacheFactory cf = new CacheFactory(); cf.set(MCAST_PORT, "0"); cf.set(ConfigurationProperties.LOCATORS, ""); cf.set(ConfigurationProperties.LOG_LEVEL, System.getProperty("logLevel", "info")); return cf; }
public static Integer createCacheServerFromXml(URL url) { CacheFactory ccf = new CacheFactory(); try { File cacheXmlFile = new File(url.toURI().getPath()); ccf.set(CACHE_XML_FILE, cacheXmlFile.toURI().getPath()); ccf.set(MCAST_PORT, "0"); ccf.set(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); } catch (URISyntaxException e) { throw new ExceptionInInitializerError(e); } cache = ccf.create(); return new Integer(cache.getCacheServers().get(0).getPort()); }
public static void startCache() { try { if (cache.isClosed()) { cache = (InternalCache) new CacheFactory(props).create(); ds = cache.getDistributedSystem(); qs = cache.getQueryService(); } } catch (Exception e) { throw new AssertionError(e); } }
protected Cache createCache() { cache = new CacheFactory(props).create(); ds = cache.getDistributedSystem(); logWriter = cache.getLogger(); return cache; }
private void startGemFire() { this.cache = GemFireCacheImpl.getInstance(); if (this.cache == null) { CacheFactory cacheFactory = new CacheFactory(); this.cache = cacheFactory.create(); } logger = this.cache.getLogger(); }
private void createCache() { this.cache = (GemFireCacheImpl) new CacheFactory().set(MCAST_PORT, "0") .set(LOG_LEVEL, "warning").create(); }
public static Integer createCacheServerFromXmlN(URL url) { CacheFactory ccf = new CacheFactory(); try { File cacheXmlFile = new File(url.toURI().getPath()); ccf.set(CACHE_XML_FILE, cacheXmlFile.toURI().getPath()); ccf.set(MCAST_PORT, "0"); ccf.set(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); ccf.set(LOG_FILE, "abs_server_system.log"); ccf.set(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel()); } catch (URISyntaxException e) { throw new ExceptionInInitializerError(e); } cache = ccf.create(); return new Integer(cache.getCacheServers().get(0).getPort()); }
private void startCache(DistributedSystem ds) { InternalCache internalCache = GemFireCacheImpl.getInstance(); if (internalCache == null) { logger.info("Creating cache for locator."); this.myCache = (InternalCache) new CacheFactory(ds.getProperties()).create(); internalCache = this.myCache; } else { logger.info("Using existing cache for locator."); ((InternalDistributedSystem) ds).handleResourceEvent(ResourceEvent.LOCATOR_START, this); } startJmxManagerLocationService(internalCache); startClusterManagementService(); }
private static void init() throws TimeoutException, CacheWriterException, GatewayException, RegionExistsException { if (GemFireCacheImpl.getInstance() == null) { props.setProperty(MCAST_PORT, "0"); cache = (InternalCache) new CacheFactory(props).create(); } else { cache = GemFireCacheImpl.getInstance(); } ds = cache.getDistributedSystem(); qs = cache.getQueryService(); }
public static void restartCache() { try { if (!cache.isClosed()) { cache.close(); } cache = (InternalCache) new CacheFactory(props).create(); ds = cache.getDistributedSystem(); qs = cache.getQueryService(); } catch (Exception e) { throw new AssertionError(e); } }
@Override protected void before() { this.cache = (InternalCache) new CacheFactory().set(MCAST_PORT, "0").create(); }
@Before public void setUp() throws Exception { cache = new CacheFactory().set(ConfigurationProperties.LOCATORS, "").create(); Region region = cache.createRegionFactory(RegionShortcut.LOCAL).create("region"); IntStream.range(0, 2).forEach(i -> region.put("key" + i, new PortfolioPdx(i))); }
@Before public void setUp() throws Exception { CacheFactory cacheFactory = new CacheFactory(); cacheFactory.set(ConfigurationProperties.MCAST_PORT, "0"); cacheFactory.set(ConfigurationProperties.USE_CLUSTER_CONFIGURATION, "false"); cacheFactory.set(ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION, "false"); cache = cacheFactory.create(); }
@Before public void setUp() throws Exception { File storeDirectory = baseDir.newFolder("store"); snapshotDirectory = baseDir.newFolder("snapshots"); regionGenerator = new RegionGenerator(); CacheFactory cf = new CacheFactory().set(MCAST_PORT, "0").set(LOG_LEVEL, "error"); cache = cf.create(); diskStore = cache.createDiskStoreFactory().setMaxOplogSize(1) .setDiskDirs(new File[] {storeDirectory}).create("snapshotTest"); }