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

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

Introduction

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

Prototype

@Override
public void setMemoryCacheName(String s) 

Source Link

Document

Sets the memoryCacheName attribute of the CompositeCacheAttributes object

Usage

From source file:org.openstreetmap.josm.plugins.openstreetcam.cache.CacheManager.java

private CacheManager() {
    final String pluginLocation = new File(Preferences.main().getPluginsDirectory(),
            GuiConfig.getInstance().getPluginShortName()).getPath();
    final CacheSettings settings = PreferenceManager.getInstance().loadPreferenceSettings().getCacheSettings();

    this.cache = JCSCacheManager.getCache(CACHE_NAME, settings.getMemoryCount(), settings.getDiskCount(),
            pluginLocation + CACHE_LOCATION);
    final CompositeCacheAttributes attr = (CompositeCacheAttributes) this.cache.getCacheAttributes();
    attr.setDiskUsagePattern(DiskUsagePattern.SWAP);
    attr.setMemoryCacheName(MEMORY_MANAGER);
    attr.setUseMemoryShrinker(true);//from w w w .  ja  v  a2s  .co m
    this.cache.setCacheAttributes(attr);
    this.cache.clear();
}