Example usage for org.apache.commons.jcs.engine CompositeCacheAttributes setMaxObjects

List of usage examples for org.apache.commons.jcs.engine CompositeCacheAttributes setMaxObjects

Introduction

In this page you can find the example usage for org.apache.commons.jcs.engine CompositeCacheAttributes setMaxObjects.

Prototype

@Override
public void setMaxObjects(int maxObjs) 

Source Link

Document

Sets the maxObjects attribute of the CompositeCacheAttributes object

Usage

From source file:org.mkosem.impl.JCSCache.java

public JCSCache(int capacity, int concurrencyLevel) throws CacheException {
    JCS.setConfigProperties(new Properties());
    CompositeCacheAttributes attributes = new CompositeCacheAttributes();
    attributes.setMaxObjects(capacity);
    attributes.setUseDisk(false);//  w  ww.  ja v a  2s  .c  o m
    attributes.setUseRemote(false);
    attributes.setUseLateral(false);
    cache_ = JCS.getInstance("test", attributes);
}

From source file:org.openstreetmap.josm.data.cache.JCSCacheManager.java

private static CompositeCacheAttributes getCacheAttributes(int maxMemoryElements) {
    CompositeCacheAttributes ret = new CompositeCacheAttributes();
    ret.setMaxObjects(maxMemoryElements);
    ret.setDiskUsagePattern(DiskUsagePattern.UPDATE);
    return ret;//  ww w.  j av  a 2s . c  om
}