use of lucee.runtime.cache.ram.RamCache in project Lucee by lucee.
the class CacheResourceProvider method getCache.
public Cache getCache() {
PageContext pc = ThreadLocalPageContext.get();
Cache c = CacheUtil.getDefault(pc, Config.CACHE_TYPE_RESOURCE, null);
if (c == null) {
// CFMLEngineImpl e=null;
if (defaultCache == null) {
defaultCache = new RamCache().init(0, 0, RamCache.DEFAULT_CONTROL_INTERVAL);
}
c = defaultCache;
}
if (!inits.contains(c.hashCode())) {
String k = toKey("null", "");
try {
if (!c.contains(k)) {
CacheResourceCore value = new CacheResourceCore(CacheResourceCore.TYPE_DIRECTORY, null, "");
c.put(k, value, Constants.LONG_ZERO, Constants.LONG_ZERO);
}
} catch (IOException e) {
// simply ignore
}
inits.add(c.hashCode());
}
return c;
}
use of lucee.runtime.cache.ram.RamCache in project Lucee by lucee.
the class TimespanCacheHandler method getCache.
private Cache getCache(PageContext pc) {
Cache cache = CacheUtil.getDefault(pc, cacheType, null);
if (cache == null) {
if (defaultCache == null) {
RamCache rm = new RamCache().init(0, 0, RamCache.DEFAULT_CONTROL_INTERVAL);
rm.decouple();
defaultCache = rm;
}
return defaultCache;
}
if (cache instanceof CachePro)
return ((CachePro) cache).decouple();
return cache;
}
use of lucee.runtime.cache.ram.RamCache in project Lucee by lucee.
the class ConfigImpl method createRAMCache.
// used by argus cache FUTURE add to interface
/**
* creates a new RamCache, please make sure to finalize.
* @param arguments possible arguments are "timeToLiveSeconds", "timeToIdleSeconds" and "controlInterval"
* @throws IOException
*/
public Cache createRAMCache(Struct arguments) throws IOException {
RamCache rc = new RamCache();
if (arguments == null)
arguments = new StructImpl();
rc.init(this, "" + CreateUniqueId.invoke(), arguments);
return rc;
}
Aggregations