/** * 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()); }
public static void startCache() { try { if (cache.isClosed()) { cache = CacheFactory.create(ds); } } catch (Exception e) { e.printStackTrace(); } }
private static synchronized Cache create(DistributedSystem system, boolean existingOk, CacheConfig cacheConfig) throws CacheExistsException, TimeoutException, CacheWriterException, GatewayException, RegionExistsException { // Moved code in this method to GemFireCacheImpl.create return GemFireCacheImpl.create((InternalDistributedSystem) system, existingOk, cacheConfig); }
public static void restartCache() { try { if (!cache.isClosed()) { cache.close(); } cache = CacheFactory.create(ds); } catch (Exception e) { e.printStackTrace(); } }
protected static void createCache(Integer locPort) { AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(); Properties props = test.getDistributedSystemProperties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, "localhost[" + locPort + "]"); InternalDistributedSystem ds = test.getSystem(props); cache = CacheFactory.create(ds); }
public static void createCacheWithoutLocator(Integer mCastPort) { AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(); Properties props = test.getDistributedSystemProperties(); props.setProperty(MCAST_PORT, "" + mCastPort); InternalDistributedSystem ds = test.getSystem(props); cache = CacheFactory.create(ds); }
@Before public void createCache() { CacheFactory cf = getCacheFactory(); this.cache = cf.create(); luceneService = LuceneServiceProvider.get(this.cache); }
protected Cache createCache() { cache = new CacheFactory(props).create(); ds = cache.getDistributedSystem(); logWriter = cache.getLogger(); return cache; }
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); } }
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(); }
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(); }
@Override protected void before() { this.cache = (InternalCache) new CacheFactory().set(MCAST_PORT, "0").create(); }
private void createCache(Properties props) throws Exception { DistributedSystem ds = getSystem(props); assertNotNull(ds); ds.disconnect(); ds = getSystem(props); cache = CacheFactory.create(ds); assertNotNull(cache); }
private void openCache() { assertNotNull(distributedTestCase.basicGetSystem()); assertTrue(distributedTestCase.basicGetSystem().isConnected()); cache = CacheFactory.create(distributedTestCase.basicGetSystem()); assertNotNull(cache); }
private void setUp() throws CacheException { this.ds = DistributedSystem.connect(new Properties()); this.cache = CacheFactory.create(ds); AttributesFactory attributesFactory = new AttributesFactory(); attributesFactory.setValueConstraint(Portfolio.class); this.regionAttributes = attributesFactory.create(); this.qs = this.cache.getQueryService(); }
@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(); }