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


Java CacheService类代码示例

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


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

示例1: cacheService

import org.osgl.cache.CacheService; //导入依赖的package包/类
public CacheService cacheService(String name) {
    if (null == cacheServiceProvider) {
        try {
            cacheServiceProvider = get(AppConfigKey.CACHE_IMPL, null);
        } catch (ConfigurationException e) {
            Object obj = helper.getValFromAliases(raw, AppConfigKey.CACHE_IMPL.toString(), "impl", null);
            cacheServiceProvider = CacheServiceProvider.Impl.valueOfIgnoreCase(obj.toString());
            if (null != cacheServiceProvider) {
                set(AppConfigKey.CACHE_IMPL, cacheServiceProvider);
                return cacheServiceProvider.get(name);
            }
            throw e;
        }
        if (null == cacheServiceProvider) {
            cacheServiceProvider = CacheServiceProvider.Impl.Auto;
        }
    }
    return cacheServiceProvider.get(name);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:20,代码来源:AppConfig.java

示例2: initCache

import org.osgl.cache.CacheService; //导入依赖的package包/类
private void initCache() {
    cache = cache(config().cacheName());
    cache.startup();
    CacheService sessionCache = cache(config().cacheNameSession());
    if (cache != sessionCache) {
        sessionCache.startup();
    }
    HttpConfig.setSessionCache(sessionCache);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:10,代码来源:App.java

示例3: cs

import org.osgl.cache.CacheService; //导入依赖的package包/类
private static CacheService cs() {
    if (null != cs) return cs;
    synchronized (H.class) {
        if (null == cs) {
            cs = HttpConfig.sessionCache();
        }
        return cs;
    }
}
 
开发者ID:osglworks,项目名称:java-http,代码行数:10,代码来源:H.java

示例4: getProperty

import org.osgl.cache.CacheService; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static <T> T getProperty(CacheService cache, Object entity, String property) {
    E.NPE(entity);
    if (property.contains("]")) {
        property = property.replace('[', '.').replace("]", "");
    }
    if (property.contains(".")) {
        return getProperty(cache, entity, property.split("\\."));
    } else if (property.contains("/")) {
        return getProperty(cache, entity, property.split("\\/"));
    }
    PropertyGetter gettter = propertyGetter(cache, entity, property, false);
    return cast(gettter.get(entity, property));
}
 
开发者ID:osglworks,项目名称:java-tool,代码行数:15,代码来源:Osgl.java

示例5: setProperty

import org.osgl.cache.CacheService; //导入依赖的package包/类
public static void setProperty(CacheService cache, Object entity, Object val, String property) {
    E.NPE(entity);
    if (property.contains("]")) {
        property = property.replace('[', '.').replace("]", "");
    }
    if (property.contains(".")) {
        setProperty(cache, entity, val, property.split("\\."));
    } else if (property.contains("/")) {
        setProperty(cache, entity, val, property.split("\\/"));
    } else {
        PropertySetter setter = propertySetter(cache, entity, property);
        setter.set(entity, val, property);
    }
}
 
开发者ID:osglworks,项目名称:java-tool,代码行数:15,代码来源:Osgl.java

示例6: cache

import org.osgl.cache.CacheService; //导入依赖的package包/类
private static CacheService cache() {
    if (null != cache) {
        return cache;
    }
    synchronized (Session.class) {
        if (null == cache) {
            cache = CacheServiceProvider.Impl.Auto.get();
            CacheServiceRegistry.register(cache);
        }
    }
    return cache;
}
 
开发者ID:rythmengine,项目名称:spring-rythm,代码行数:13,代码来源:Session.java

示例7: _destroy

import org.osgl.cache.CacheService; //导入依赖的package包/类
public static void _destroy() {
    for (CacheService svc : registry) {
        try {
            svc.shutdown();
        } catch (Exception e) {
            logger.warn(e, "Error shutting down cache service: %s", svc);
            // ignore
        }
    }
    registry.clear();
}
 
开发者ID:rythmengine,项目名称:spring-rythm,代码行数:12,代码来源:CacheServiceRegistry.java

示例8: cache

import org.osgl.cache.CacheService; //导入依赖的package包/类
public CacheService cache() {
    return cache;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:4,代码来源:App.java

示例9: get

import org.osgl.cache.CacheService; //导入依赖的package包/类
@Override
public CacheService get() {
    return app().cache();
}
 
开发者ID:actframework,项目名称:actframework,代码行数:5,代码来源:ActProviders.java

示例10: evaluatorCache

import org.osgl.cache.CacheService; //导入依赖的package包/类
public CacheService evaluatorCache() {
    return evaluatorCache;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:4,代码来源:CliContext.java

示例11: CollectionASCIITableAware

import org.osgl.cache.CacheService; //导入依赖的package包/类
public CollectionASCIITableAware(List<T> objList, List<String> properties, List<String> title) {
	if (objList != null && !objList.isEmpty() && properties != null && !properties.isEmpty()) {
		//Populate header
		String header;
		headers = new ArrayList<ASCIITableHeader>(properties.size());
		int titleSize = title.size();
		properties = new ArrayList<String>(properties);
		for (int i = 0 ; i < properties.size() ; i ++) {
			String prop = properties.get(i);
			header = prop;
			if (i < titleSize) {
				header = title.get(i);
				if (null == header) {
					header = prop;
				}
			}
			int pos = header.indexOf(" as ");
			if (pos > -1) {
				header = header.substring(pos + 4).trim();
				prop = prop.substring(0, pos).trim();
				properties.remove(i);
				properties.add(i, prop);
			}
			headers.add(new ASCIITableHeader(Keyword.of(String.valueOf(header)).constantName()));
		}
		
		//Populate data
		data = new ArrayList<List<Object>>();
		List<Object> rowData;
		Class<?> dataClazz = Object.class;
		for (Object o: objList) {
			if (null != o) {
				dataClazz = o.getClass();
				break;
			}
		}
		Map<String, Serializable> propertyExtractorMap = new HashMap<String, Serializable>();
		CacheService cache = null;
		CliContext ctx = CliContext.current();
		if (null != ctx) {
			cache = ctx.evaluatorCache();
		}
		for (int i = 0 ; i < objList.size() ; i ++) {
			rowData = new ArrayList<Object>();
			
			for (int j = 0 ; j < properties.size() ; j ++) {
				rowData.add(getProperty(cache,
						dataClazz, objList.get(i), properties.get(j)));
			}
			
			data.add(rowData);
		}//iterate rows
		
	}
}
 
开发者ID:actframework,项目名称:actframework,代码行数:56,代码来源:CollectionASCIITableAware.java

示例12: getProperty

import org.osgl.cache.CacheService; //导入依赖的package包/类
private Object getProperty(CacheService evaluatorCache, Class<?> dataClazz, T obj, String property) {
	if (S.eq("this", property)) {
		return obj;
	}
	return $.getProperty(evaluatorCache, obj, property);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:7,代码来源:CollectionASCIITableAware.java

示例13: setSessionCache

import org.osgl.cache.CacheService; //导入依赖的package包/类
public static void setSessionCache(CacheService cache) {
    sessionCache = $.notNull(cache);
}
 
开发者ID:osglworks,项目名称:java-http,代码行数:4,代码来源:HttpConfig.java

示例14: sessionCache

import org.osgl.cache.CacheService; //导入依赖的package包/类
public static CacheService sessionCache() {
    return sessionCache;
}
 
开发者ID:osglworks,项目名称:java-http,代码行数:4,代码来源:HttpConfig.java

示例15: register

import org.osgl.cache.CacheService; //导入依赖的package包/类
public static void register(CacheService svc) {
    E.NPE(svc);
    registry.add(svc);
}
 
开发者ID:rythmengine,项目名称:spring-rythm,代码行数:5,代码来源:CacheServiceRegistry.java


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