本文整理汇总了Java中lucee.commons.io.cache.CacheEntry.lastModified方法的典型用法代码示例。如果您正苦于以下问题:Java CacheEntry.lastModified方法的具体用法?Java CacheEntry.lastModified怎么用?Java CacheEntry.lastModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lucee.commons.io.cache.CacheEntry
的用法示例。
在下文中一共展示了CacheEntry.lastModified方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toString
import lucee.commons.io.cache.CacheEntry; //导入方法依赖的package包/类
public static String toString(CacheEntry ce) {
return "created: "+ce.created()
+"\nlast-hit: "+ce.lastHit()
+"\nlast-modified: "+ce.lastModified()
+"\nidle-time: "+ce.idleTimeSpan()
+"\nlive-time :"+ce.liveTimeSpan()
+"\nhit-count: "+ce.hitCount()
+"\nsize: "+ce.size();
}
示例2: clean
import lucee.commons.io.cache.CacheEntry; //导入方法依赖的package包/类
private void clean(CacheConnection cc, ConfigWebImpl config) throws IOException {
Cache cache = cc.getInstance(config);
int len=filter.length(),index;
List<CacheEntry> entries = cache.entries(filter);
CacheEntry ce;
long expires;
String key,appname,cfid;
if(entries.size()>0){
Iterator<CacheEntry> it = entries.iterator();
while(it.hasNext()){
ce=it.next();
Date lm = ce.lastModified();
long time=lm!=null?lm.getTime():0;
expires=time+ce.idleTimeSpan()-StorageScopeCache.SAVE_EXPIRES_OFFSET;
if(expires<=System.currentTimeMillis()) {
key=ce.getKey().substring(len);
index=key.indexOf(':');
cfid=key.substring(0,index);
appname=key.substring(index+1);
if(listener!=null)listener.doEnd(engine, this,appname, cfid);
info("remove "+strType+"/"+appname+"/"+cfid+" from cache "+cc.getName());
engine.remove(type,appname,cfid);
cache.remove(ce.getKey());
}
}
}
//engine.remove(type,appName,cfid);
//return (Struct) cache.getValue(key,null);
}
示例3: clean
import lucee.commons.io.cache.CacheEntry; //导入方法依赖的package包/类
private void clean(CacheConnection cc, ConfigWebImpl config) throws IOException {
Cache cache = cc.getInstance(config);
int len=filter.length(),index;
List<CacheEntry> entries = cache.entries(filter);
CacheEntry ce;
long expires;
String key,appname,cfid;
if(entries.size()>0){
Iterator<CacheEntry> it = entries.iterator();
while(it.hasNext()){
ce=it.next();
Date lm = ce.lastModified();
long time=lm!=null?lm.getTime():0;
expires=time+ce.idleTimeSpan()-StorageScopeCache.SAVE_EXPIRES_OFFSET;
if(expires<=System.currentTimeMillis()) {
key=ce.getKey().substring(len);
index=key.indexOf(':');
cfid=key.substring(0,index);
appname=key.substring(index+1);
if(listener!=null)listener.doEnd(engine, this,appname, cfid);
info("remove "+strType+"/"+appname+"/"+cfid+" from cache "+cc.getName());
engine.remove(type,appname,cfid);
cache.remove(ce.getKey());
}
}
}
//engine.remove(type,appName,cfid);
//return (Struct) cache.getValue(key,null);
}