private void setupSerializer(ReflectionBasedAutoSerializer s, boolean readSerialized) { this.serializer = s; this.manager = AutoSerializableManager.getInstance(s); this.c = (GemFireCacheImpl) new CacheFactory(). set("mcast-port", "0"). setPdxReadSerialized(readSerialized). setPdxSerializer(s). create(); } /*
@Override public void setUp() { // make it a loner this.c = (GemFireCacheImpl) new CacheFactory() .set("mcast-port", "0") .setPdxReadSerialized(true) .create(); }
@Override public void setUp() { // make it a loner this.cache = (GemFireCacheImpl) new CacheFactory() .set("mcast-port", "0") .setPdxReadSerialized(true) .create(); }
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["+DistributedTestCase.getDUnitLocatorPort()+"]"); } catch (URISyntaxException e) { throw new ExceptionInInitializerError(e); } cache = ccf.create(); return new Integer(cache.getCacheServers().get(0).getPort()); }
private static Cache createCache() { Properties p = new Properties(); p.setProperty("locators", ""); return new CacheFactory(p) .set("mcast-port", "0") .create(); }
@Override public Object call() throws Exception { CacheFactory cf = new CacheFactory(); cf.set("mcast-port", "45934"); cf.set("conserve-sockets", "false"); getCache(cf).<Integer, Integer> createRegionFactory(RegionShortcut.REPLICATE_PERSISTENT) .create(name); AbstractUpdateOperation.test_InvalidVersion = true; return null; } };
@Override public void setUp() { // make it a loner this.c = (GemFireCacheImpl) new CacheFactory().set("mcast-port", "0") .create(); }
public synchronized void init() { Assert.state(!isInitialized(), "The Phone Directory DAO ({0}) has been already been initialized!", getClass().getName()); // TODO the cache is a perfect candidate for configuration and dependency injection using Spring baby! // TODO use the Spring GemFire Integration API this.phoneDirectoryCache = new CacheFactory(getGemFireConfiguration()) .set("name", PHONE_DIRECTORY_CACHE_NAME) .create(); this.phoneDirectoryCache.loadCacheXml(getCacheConfiguration()); this.phoneDirectoryRegion = phoneDirectoryCache.getRegion(PHONE_DIRECTORY_REGION_PATH); this.configured = false; this.destroyed = false; this.initialized = true; }
private void setUpGem(File diskdir) { CacheFactory cf = new CacheFactory() .set("mcast-port", "0"); cache = cf.create(); ds = cache.createDiskStoreFactory() .setDiskDirs(new File[] { diskdir }) .setMaxOplogSize(SIZE / 16 / 1024 / 1024) .create("store1"); region = cache .<Long, Object>createRegionFactory(RegionShortcut.LOCAL_PERSISTENT) .setDiskStoreName(ds.getName()) .setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)) .create("test"); }
@Override public void run() { Cache cache = getCache(new CacheFactory().set("log-level", getDUnitLogLevel())); cache.createDiskStoreFactory().setDiskDirs(getDiskDirs()).create("fooStore"); cache.createDiskStoreFactory().setDiskDirs(getDiskDirs()).create("barStore"); getRegionFactory(cache).setDiskStoreName("fooStore").create("fooRegion"); getRegionFactory(cache).setDiskStoreName("barStore").create("barRegion"); }