当前位置: 首页>>代码示例>>Java>>正文


Java CacheEntryFilter类代码示例

本文整理汇总了Java中lucee.commons.io.cache.CacheEntryFilter的典型用法代码示例。如果您正苦于以下问题:Java CacheEntryFilter类的具体用法?Java CacheEntryFilter怎么用?Java CacheEntryFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CacheEntryFilter类属于lucee.commons.io.cache包,在下文中一共展示了CacheEntryFilter类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: remove

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public int remove(CacheEntryFilter filter) {
	DBCursor cur = qAll();
	int counter = 0;

	while (cur.hasNext()) {
		BasicDBObject obj = (BasicDBObject) cur.next();
		MongoDBCacheEntry entry = new MongoDBCacheEntry(new MongoDBCacheDocument(obj));
		if (filter.accept(entry)) {
			doDelete(obj);
			counter++;
		}
	}

	return counter;
}
 
开发者ID:lucee,项目名称:extension-mongodb,代码行数:17,代码来源:MongoDBCache.java

示例2: values

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public List<Object> values(CacheEntryFilter filter) {
	DBCursor cur = qAll_Keys_Values();
	List<Object> result = new ArrayList<Object>();

	while (cur.hasNext()) {
		BasicDBObject obj = (BasicDBObject) cur.next();
		MongoDBCacheEntry entry = new MongoDBCacheEntry(new MongoDBCacheDocument(obj));

		if (filter.accept(entry)) {
			try {
				result.add(MongoDBCacheDocument.getValue(obj));
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}

	}

	return result;
}
 
开发者ID:lucee,项目名称:extension-mongodb,代码行数:22,代码来源:MongoDBCache.java

示例3: values

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public List values(CacheEntryFilter filter) throws IOException {
	if(CacheUtil.allowAll(filter)) return values();
	
	List<String> keys = keys();
	List<Object> list=new ArrayList<Object>();
	Iterator<String> it = keys.iterator();
	String key;
	CacheEntry entry;
	while(it.hasNext()){
		key=it.next();
		entry=getQuiet(key,null);
		if(filter.accept(entry))list.add(entry.getValue());
	}
	return list;
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:17,代码来源:CacheSupport.java

示例4: remove

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public int remove(CacheEntryFilter filter) throws IOException {
	if(CacheUtil.allowAll(filter)) return clear();
	
	List<String> keys = keys();
	int count=0;
	Iterator<String> it = keys.iterator();
	String key;
	CacheEntry entry;
	while(it.hasNext()){
		key=it.next();
		entry=getQuiet(key,null);
		if(filter==null || filter.accept(entry)){
			remove(key);
			count++;
		}
	}
	return count;
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:20,代码来源:CacheSupport.java

示例5: values

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public List values(CacheEntryFilter filter) throws IOException {
	if(CacheUtil.allowAll(filter)) return values();

	List<String> keys = keys();
	List<Object> list=new ArrayList<Object>();
	Iterator<String> it = keys.iterator();
	String key;
	CacheEntry entry;
	while(it.hasNext()){
		key=it.next();
		entry=getQuiet(key,null);
		if(filter.accept(entry))list.add(entry.getValue());
	}
	return list;
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:17,代码来源:CacheSupport.java

示例6: remove

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public int remove(CacheEntryFilter filter) throws IOException {
	if(CacheUtil.allowAll(filter)) return clear();

	List<String> keys = keys();
	int count=0;
	Iterator<String> it = keys.iterator();
	String key;
	CacheEntry entry;
	while(it.hasNext()){
		key=it.next();
		entry=getQuiet(key,null);
		if(filter==null || filter.accept(entry)){
			remove(key);
			count++;
		}
	}
	return count;
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:20,代码来源:CacheSupport.java

示例7: _call

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
private static double _call(PageContext pc,Object filterOrTags, String cacheName) throws PageException {
	try {
		Object filter=FILTER;
		// tags
		if(Decision.isArray(filterOrTags)) {
			String[] arr = ListUtil.toStringArray(Caster.toArray(filterOrTags));
			filter=new QueryTagFilter(arr);
		}
		// filter
		else {
			String strFilter=Caster.toString(filterOrTags);
			if(CacheGetAllIds.isFilter(strFilter))
				filter=new WildCardFilter(strFilter,true);
			
		}
		
		Cache cache = CacheUtil.getCache(pc,cacheName,Config.CACHE_TYPE_OBJECT);
		if(filter instanceof CacheKeyFilter)
			return cache.remove((CacheKeyFilter)filter);
		return cache.remove((CacheEntryFilter)filter);
		
	} catch (Exception e) {
		throw Caster.toPageException(e);
	}
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:26,代码来源:CacheClear.java

示例8: entries

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public List<CacheEntry> entries(CacheEntryFilter filter) {
	List<CacheEntry> result = new ArrayList<CacheEntry>();
	DBCursor cur = qAll();

	while (cur.hasNext()) {
		BasicDBObject obj = (BasicDBObject) cur.next();
		MongoDBCacheDocument doc = new MongoDBCacheDocument(obj);
		MongoDBCacheEntry entry = new MongoDBCacheEntry(doc);
		if (filter.accept(entry)) {
			result.add(entry);
		}
	}
	return result;
}
 
开发者ID:lucee,项目名称:extension-mongodb,代码行数:16,代码来源:MongoDBCache.java

示例9: keys

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public List keys(CacheEntryFilter filter) {
	List<String> result = new ArrayList<String>();
	DBCursor cur = qAll();

	if (cur.count() > 0) {
		while (cur.hasNext()) {
			MongoDBCacheEntry entry = new MongoDBCacheEntry(new MongoDBCacheDocument((BasicDBObject) cur.next()));
			if (filter.accept(entry)) {
				result.add(entry.getKey());
			}
		}
	}
	return result;
}
 
开发者ID:lucee,项目名称:extension-mongodb,代码行数:16,代码来源:MongoDBCache.java

示例10: entries

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public List<CacheEntry> entries(CacheEntryFilter filter) throws IOException {
	List<String> keys = keys();
	List<CacheEntry> list=new ArrayList<CacheEntry>();
	Iterator<String> it = keys.iterator();
	CacheEntry entry;
	while(it.hasNext()){
		entry=getQuiet(it.next(),null);
		if(filter.accept(entry))list.add(entry);
	}
	return list;
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:13,代码来源:CacheSupport.java

示例11: entries

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public List<CacheEntry> entries(CacheEntryFilter filter) throws IOException {
	return entries(cache.entries(filter));
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:5,代码来源:CacheComplex.java

示例12: remove

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public int remove(CacheEntryFilter filter) throws IOException {
	return cache.remove(filter);
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:5,代码来源:CacheComplex.java

示例13: keys

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public List<String> keys(CacheEntryFilter filter) throws IOException {
	return cache.keys(filter);
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:5,代码来源:CacheComplex.java

示例14: values

import lucee.commons.io.cache.CacheEntryFilter; //导入依赖的package包/类
@Override
public List<Object> values(CacheEntryFilter filter) throws IOException {
	return values(cache.values(filter));
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:5,代码来源:CacheComplex.java


注:本文中的lucee.commons.io.cache.CacheEntryFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。