Example usage for org.apache.commons.jcs JCS getInstance

List of usage examples for org.apache.commons.jcs JCS getInstance

Introduction

In this page you can find the example usage for org.apache.commons.jcs JCS getInstance.

Prototype

public static <K, V> CacheAccess<K, V> getInstance(String region, ICompositeCacheAttributes icca)
        throws CacheException 

Source Link

Document

Get a CacheAccess which accesses the provided region.

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);//w w  w. jav  a  2 s.  co m
    attributes.setUseDisk(false);
    attributes.setUseRemote(false);
    attributes.setUseLateral(false);
    cache_ = JCS.getInstance("test", attributes);
}