/** Create an instance of a fake cache, which is used by * com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator * * @param cacheDef The description of the cache to create a fake * cache object for. * * @returns A fake cache (one that doesn't really exist, but contains * the appropriate cache settings). */ private static CacheCreation createFakeCache(CacheDefinition cacheDef) { CacheCreation fakeCache = new CacheCreation(); Boolean aBool = cacheDef.getCopyOnRead(); if (aBool != null) fakeCache.setCopyOnRead(aBool.booleanValue()); Integer anInt = cacheDef.getLockTimeout(); if (anInt != null) fakeCache.setLockTimeout(anInt.intValue()); anInt = cacheDef.getSearchTimeout(); if (anInt != null) fakeCache.setSearchTimeout(anInt.intValue()); return fakeCache; }
this.cache.setLockTimeout(parseInt(lockTimeout));
this.cache.setLockTimeout(parseInt(lockTimeout));
/** * Tests creating a cache with non-default lock-timeout, lock-lease, * and search-timeout. */ public void testNonDefaultCache() { CacheCreation cache = new CacheCreation(); cache.setLockTimeout(42); cache.setLockLease(43); cache.setSearchTimeout(44); if (getGemFireVersion().compareTo(CacheXml.VERSION_4_0) >= 0) { cache.setCopyOnRead(true); } testXml(cache); }
/** * Creates a generator for a default cache. */ private CacheXmlGenerator() { this.cache = null; this.useSchema = false; this.version = VERSION_LATEST; this.generateDefaults = true; this.creation = new CacheCreation(); creation.setLockLease(GemFireCacheImpl.DEFAULT_LOCK_LEASE); creation.setLockTimeout(GemFireCacheImpl.DEFAULT_LOCK_TIMEOUT); creation.setSearchTimeout(GemFireCacheImpl.DEFAULT_SEARCH_TIMEOUT); // No cache proxy creation.setIsServer(false); creation.setCopyOnRead(GemFireCacheImpl.DEFAULT_COPY_ON_READ); }
/** * Creates a generator for a default cache. */ private CacheXmlGenerator() { this.cache = null; this.useSchema = true; this.version = CacheXmlVersion.valueForVersion(VERSION_LATEST); this.generateDefaults = true; this.creation = new CacheCreation(); creation.setLockLease(GemFireCacheImpl.DEFAULT_LOCK_LEASE); creation.setLockTimeout(GemFireCacheImpl.DEFAULT_LOCK_TIMEOUT); creation.setSearchTimeout(GemFireCacheImpl.DEFAULT_SEARCH_TIMEOUT); // No cache proxy creation.setIsServer(false); creation.setCopyOnRead(GemFireCacheImpl.DEFAULT_COPY_ON_READ); }
creation.setIsServer(isServer1); creation.setLockLease(lockLease1); creation.setLockTimeout(lockTimeout1); creation.setSearchTimeout(searchTimeout1); creation.setIsServer(isServer2); creation.setLockLease(lockLease2); creation.setLockTimeout(lockTimeout2); creation.setSearchTimeout(searchTimeout2);
this.creation.setLockTimeout(cache.getLockTimeout()); this.creation.setLockTimeout(cache.getLockTimeout());
this.creation.setLockTimeout(cache.getLockTimeout()); this.creation.setLockTimeout(cache.getLockTimeout());