Changeset 8509 in josm for trunk/src/org/openstreetmap/josm/data/cache
- Timestamp:
- 2015-06-20T14:36:00+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/cache
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
r8487 r8509 73 73 jcsLog.setLevel(Level.INFO); 74 74 jcsLog.setUseParentHandlers(false); 75 //Logger.getLogger("org.apache.common").setUseParentHandlers(false); 76 // we need a separate handler from Main's, as we downgrade LEVEL.INFO to DEBUG level 75 // we need a separate handler from Main's, as we downgrade LEVEL.INFO to DEBUG level 77 76 jcsLog.addHandler(new Handler() { 78 77 @Override … … 100 99 }); 101 100 102 103 CompositeCacheManager cm = CompositeCacheManager.getUnconfiguredInstance();104 101 // this could be moved to external file 105 102 Properties props = new Properties(); 106 103 // these are default common to all cache regions 107 104 // use of auxiliary cache and sizing of the caches is done with giving proper geCache(...) params 108 props.setProperty("jcs.default.cacheattributes", org.apache.commons.jcs.engine.CompositeCacheAttributes.class.getCanonicalName()); 109 props.setProperty("jcs.default.cacheattributes.MaxObjects", DEFAULT_MAX_OBJECTS_IN_MEMORY.get().toString()); 110 props.setProperty("jcs.default.cacheattributes.UseMemoryShrinker", "true"); 111 props.setProperty("jcs.default.cacheattributes.DiskUsagePatternName", "UPDATE"); // store elements on disk on put 112 props.setProperty("jcs.default.elementattributes", CacheEntryAttributes.class.getCanonicalName()); 113 props.setProperty("jcs.default.elementattributes.IsEternal", "false"); 114 props.setProperty("jcs.default.elementattributes.MaxLife", Long.toString(maxObjectTTL)); 115 props.setProperty("jcs.default.elementattributes.IdleTime", Long.toString(maxObjectTTL)); 116 props.setProperty("jcs.default.elementattributes.IsSpool", "true"); 105 props.setProperty("jcs.default.cacheattributes", CompositeCacheAttributes.class.getCanonicalName()); 106 props.setProperty("jcs.default.cacheattributes.MaxObjects", DEFAULT_MAX_OBJECTS_IN_MEMORY.get().toString()); 107 props.setProperty("jcs.default.cacheattributes.UseMemoryShrinker", "true"); 108 props.setProperty("jcs.default.cacheattributes.DiskUsagePatternName", "UPDATE"); // store elements on disk on put 109 props.setProperty("jcs.default.elementattributes", CacheEntryAttributes.class.getCanonicalName()); 110 props.setProperty("jcs.default.elementattributes.IsEternal", "false"); 111 props.setProperty("jcs.default.elementattributes.MaxLife", Long.toString(maxObjectTTL)); 112 props.setProperty("jcs.default.elementattributes.IdleTime", Long.toString(maxObjectTTL)); 113 props.setProperty("jcs.default.elementattributes.IsSpool", "true"); 114 CompositeCacheManager cm = CompositeCacheManager.getUnconfiguredInstance(); 117 115 cm.configure(props); 118 116 cacheManager = cm; 119 120 117 } 121 118 -
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r8485 r8509 288 288 expires = Math.min(expires, attributes.getCreateTime() + EXPIRE_TIME_SERVER_LIMIT); 289 289 if (now > expires) { 290 log.log(Level.FINE, "JCS - Object {0} has expired -> valid to {1}, now is: {2}", new Object[]{getUrl(), Long.toString(expires), Long.toString(now)}); 290 log.log(Level.FINE, "JCS - Object {0} has expired -> valid to {1}, now is: {2}", 291 new Object[]{getUrl(), Long.toString(expires), Long.toString(now)}); 291 292 return false; 292 293 }
Note:
See TracChangeset
for help on using the changeset viewer.