當前位置: 首頁>>代碼示例>>Java>>正文


Java CacheKeyFilter類代碼示例

本文整理匯總了Java中lucee.commons.io.cache.CacheKeyFilter的典型用法代碼示例。如果您正苦於以下問題:Java CacheKeyFilter類的具體用法?Java CacheKeyFilter怎麽用?Java CacheKeyFilter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CacheKeyFilter類屬於lucee.commons.io.cache包,在下文中一共展示了CacheKeyFilter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: remove

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
@Override
public int remove(CacheKeyFilter filter) {
	DBCursor cur = qAll_Keys();
	int counter = 0;

	while (cur.hasNext()) {
		DBObject obj = cur.next();
		String key = (String) obj.get("key");
		if (filter.accept(key)) {
			doDelete((BasicDBObject) obj);
			counter++;
		}
	}

	return counter;
}
 
開發者ID:lucee,項目名稱:extension-mongodb,代碼行數:17,代碼來源:MongoDBCache.java

示例2: values

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

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

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

	}

	return result;
}
 
開發者ID:lucee,項目名稱:extension-mongodb,代碼行數:22,代碼來源:MongoDBCache.java

示例3: remove

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
@Override
public int remove(CacheKeyFilter filter) throws IOException {
	if(CacheUtil.allowAll(filter)) return clear();
	
	
	List<String> keys = keys();
	int count=0;
	Iterator<String> it = keys.iterator();
	String key;
	while(it.hasNext()){
		key=it.next();
		if(filter==null || filter.accept(key)){
			remove(key);
			count++;
		}
	}
	return count;
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:19,代碼來源:CacheSupport.java

示例4: remove

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
@Override
public int remove(CacheKeyFilter filter) throws IOException {
	if(CacheUtil.allowAll(filter)) return clear();

	List<String> keys = keys();
	int count=0;
	Iterator<String> it = keys.iterator();
	String key;
	while(it.hasNext()){
		key=it.next();
		if(filter==null || filter.accept(key)){
			remove(key);
			count++;
		}
	}
	return count;
}
 
開發者ID:lucee,項目名稱:Lucee,代碼行數:18,代碼來源:CacheSupport.java

示例5: _call

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的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

示例6: entries

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

	while (cur.hasNext()) {
		BasicDBObject obj = (BasicDBObject) cur.next();
		MongoDBCacheDocument doc = new MongoDBCacheDocument(obj);
		if (filter.accept(doc.getKey())) {
			result.add(new MongoDBCacheEntry(doc));
		}
	}
	return result;
}
 
開發者ID:lucee,項目名稱:extension-mongodb,代碼行數:15,代碼來源:MongoDBCache.java

示例7: keys

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
@Override
public List<String> keys(CacheKeyFilter filter) {
	List<String> result = new ArrayList<String>();
	DBCursor cur = qAll_Keys();

	if (cur.count() > 0) {
		while (cur.hasNext()) {
			String key = new MongoDBCacheDocument((BasicDBObject) cur.next()).getKey();
			if (filter.accept(key)) {
				result.add(key);
			}
		}
	}
	return result;
}
 
開發者ID:lucee,項目名稱:extension-mongodb,代碼行數:16,代碼來源:MongoDBCache.java

示例8: entries

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
@Override
public List<CacheEntry> entries(CacheKeyFilter filter) throws IOException {
	List<String> keys = keys();
	List<CacheEntry> list=new ArrayList<CacheEntry>();
	Iterator<String> it = keys.iterator();
	String key;
	while(it.hasNext()){
		key=it.next();
		if(filter.accept(key))list.add(getQuiet(key,null));
	}
	return list;
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:13,代碼來源:CacheSupport.java

示例9: values

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
@Override
public List values(CacheKeyFilter 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;
	while(it.hasNext()){
		key=it.next();
		if(filter.accept(key))list.add(getQuiet(key,null).getValue());
	}
	return list;
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:15,代碼來源:CacheSupport.java

示例10: call

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
public static double call(PageContext pc,String strFilter, String cacheName) throws PageException {
	try {
		CacheKeyFilter f=filter;
		if(CacheGetAllIds.isFilter(strFilter))
			f=new WildCardFilter(strFilter,true);
		return Util.getCache(pc,cacheName,ConfigImpl.CACHE_DEFAULT_OBJECT).remove(f);
	} catch (Exception e) {
		throw Caster.toPageException(e);
	}
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:11,代碼來源:CacheClear.java

示例11: values

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
@Override
public List values(CacheKeyFilter 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;
	while(it.hasNext()){
		key=it.next();
		if(filter.accept(key))list.add(getQuiet(key,null).getValue());
	}
	return list;
}
 
開發者ID:lucee,項目名稱:Lucee,代碼行數:15,代碼來源:CacheSupport.java

示例12: entries

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
@Override
public List<CacheEntry> entries(CacheKeyFilter filter) throws IOException {
	return entries(cache.entries(filter));
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:5,代碼來源:CacheComplex.java

示例13: values

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
@Override
public List<Object> values(CacheKeyFilter filter) throws IOException {
	return values(cache.values(filter));
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:5,代碼來源:CacheComplex.java

示例14: keys

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
@Override
public List<String> keys(CacheKeyFilter filter) throws IOException {
	return cache.keys(filter);
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:5,代碼來源:CacheComplex.java

示例15: remove

import lucee.commons.io.cache.CacheKeyFilter; //導入依賴的package包/類
@Override
public int remove(CacheKeyFilter filter) throws IOException {
	return cache.remove(filter);
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:5,代碼來源:CacheComplex.java


注:本文中的lucee.commons.io.cache.CacheKeyFilter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。