作者:迷人的小刀 | 来源:互联网 | 2023-09-01 09:36
本文整理了Java中com.opensymphony.oscache.general.GeneralCacheAdministrator.()
方法的一些代码示例,展示了GeneralCacheAdministrator.()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeneralCacheAdministrator.()
方法的具体详情如下:
包路径:com.opensymphony.oscache.general.GeneralCacheAdministrator
类名称:GeneralCacheAdministrator
方法名:
GeneralCacheAdministrator.介绍
[英]Create the cache administrator.
[中]创建缓存管理员。
代码示例
代码示例来源:origin: javalite/activejdbc
public OSCacheManager(){
administrator = new GeneralCacheAdministrator();
}
代码示例来源:origin: org.datanucleus/datanucleus-cache
/**
* Constructor.
* @param nucleusCtx Context
*/
public OSCacheLevel2Cache(NucleusContext nucleusCtx)
{
super(nucleusCtx);
cache = new GeneralCacheAdministrator();
// TODO Implement refreshPeriod, and cron capability
}
代码示例来源:origin: com.github.tchoulihan/activejdbc
public OSCacheManager(){
administrator = new GeneralCacheAdministrator();
}
代码示例来源:origin: org.javalite/activejdbc
public OSCacheManager(){
administrator = new GeneralCacheAdministrator();
}
代码示例来源:origin: psidev.psi.mi/psimi-schema-validator
@Override
protected GeneralCacheAdministrator initialValue() {
// setting up the cache for OLS
Properties cacheProps;
InputStream is = this.getClass().getClassLoader().getResourceAsStream( cacheConfig );
cacheProps = new Properties();
try {
cacheProps.load( is );
} catch ( IOException e ) {
log.error( "Failed to load cache configuration properties for database cross reference checking: " + cacheConfig, e );
}
finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if ( cacheProps.isEmpty() ) {
log.warn( "Using default cache configuration for database cross reference checking!" );
return new GeneralCacheAdministrator();
} else {
log.info( "Using custom cache configuration from file: " + cacheConfig );
return new GeneralCacheAdministrator( cacheProps );
}
}
};
代码示例来源:origin: opensymphony/oscache
/**
* @see org.hibernate.cache.CacheProvider#start(java.util.Properties)
*/
public void start(Properties hibernateSystemProperties) throws CacheException {
if (cache == null) {
// construct the cache
LOG.debug("Starting OSCacheProvider...");
String cOnfigResourceName= null;
if (hibernateSystemProperties != null) {
cOnfigResourceName= (String) hibernateSystemProperties.get(OSCACHE_CONFIGURATION_RESOURCE_NAME);
}
if (StringUtil.isEmpty(configResourceName)) {
cache = new GeneralCacheAdministrator();
} else {
Properties propertiesOSCache = Config.loadProperties(configResourceName, this.getClass().getName());
cache = new GeneralCacheAdministrator(propertiesOSCache);
}
LOG.debug("OSCacheProvider started.");
} else {
LOG.warn("Tried to restart OSCacheProvider, which is already running.");
}
}
代码示例来源:origin: uk.ac.ebi.mydas/mydas
CACHE_MANAGER = new GeneralCacheAdministrator();
代码示例来源:origin: com.github.albfernandez.richfaces/richfaces-core
public Cache createCache(FacesContext facesContext, String cacheName, Map, ?> env) {
// TODO - handle cache name
Properties cacheProperties = new Properties();
try {
cacheProperties.putAll(loadProperties());
} catch (IOException e) {
throw new FacesException(e.getMessage(), e);
}
try {
cacheProperties.putAll(loadProperties());
} catch (IOException e) {
throw new FacesException(e.getMessage(), e);
}
cacheProperties.putAll(env);
LOG.info("Creating OSCache cache instance using parameters: " + cacheProperties);
String property = cacheProperties.getProperty(AbstractCacheAdministrator.CACHE_CAPACITY_KEY);
if (property == null) {
int maxCacheSize = getIntConfigurationValue(facesContext, CoreConfiguration.Items.resourcesCacheSize);
LOG.info(MessageFormat.format("Maximum cache size hasn''t been set, resetting to {0} max items", maxCacheSize));
cacheProperties.put(AbstractCacheAdministrator.CACHE_CAPACITY_KEY, Integer.toString(maxCacheSize));
}
GeneralCacheAdministrator cacheAdministrator = new GeneralCacheAdministrator(cacheProperties);
cacheAdministrators.add(cacheAdministrator);
return new OSCacheCache(cacheAdministrator.getCache());
}