public CachePolicy createCachePolicy() { return new TimedCachePolicy(defaultLifetime, threadSafe, resolution); } }
/** Stop cancels the resolution timer and flush()es the cache. */ public void stop() { theTimer.cancel(); flush(); } /** Clears the cache of all entries.
public void run() { TimedCachePolicy.this.run(); } }
lifetime = cache.getDefaultLifetime();
lifetime = cache.getDefaultLifetime();
public ClassReaderCache createCache() { CachePolicy policy = null; if (policyClass == TimedCachePolicy.class) policy = new TimedCachePolicy(lifetime, true, resolution); else if (policyClass == LRUCachePolicy.class) policy = new LRUCachePolicy(min, max); else { try { policy = policyClass.newInstance(); } catch(Exception e) { throw new IllegalStateException("Could not instantiate " + policyClass.getName(), e); } } try { policy.create(); policy.start(); } catch(Exception e) { throw new IllegalStateException("Error starting domain cache", e); } return new ClassReaderCache(policy); }
public CtClassCache createCache() { CachePolicy policy = null; if (policyClass == TimedCachePolicy.class) policy = new TimedCachePolicy(lifetime, true, resolution); else if (policyClass == LRUCachePolicy.class) policy = new LRUCachePolicy(min, max); else { try { policy = policyClass.newInstance(); } catch(Exception e) { throw new IllegalStateException("Could not instantiate " + policyClass.getName(), e); } } try { policy.create(); policy.start(); } catch(Exception e) { throw new IllegalStateException("Error starting domain cache", e); } return new CtClassCache(policy); }