Java 类org.apache.commons.collections.LRUMap 实例源码

项目:jerrydog    文件:ProxyDirContext.java   
/**
 * Builds a proxy directory context using the given environment.
 */
public ProxyDirContext(Hashtable env, DirContext dirContext) {
    this.env = env;
    this.dirContext = dirContext;
    if (dirContext instanceof BaseDirContext) {
        // Initialize parameters based on the associated dir context, like
        // the caching policy.
        if (((BaseDirContext) dirContext).isCached()) {
            cache = Collections.synchronizedMap(new LRUMap(cacheSize));
            cacheTTL = ((BaseDirContext) dirContext).getCacheTTL();
            cacheObjectMaxSize = 
                ((BaseDirContext) dirContext).getCacheObjectMaxSize();
        }
    }
    hostName = (String) env.get(HOST);
    contextName = (String) env.get(CONTEXT);
}
项目:HowTomcatWorks    文件:ProxyDirContext.java   
/**
 * Builds a proxy directory context using the given environment.
 */
public ProxyDirContext(Hashtable env, DirContext dirContext) {
    this.env = env;
    this.dirContext = dirContext;
    if (dirContext instanceof BaseDirContext) {
        // Initialize parameters based on the associated dir context, like
        // the caching policy.
        if (((BaseDirContext) dirContext).isCached()) {
            cache = Collections.synchronizedMap(new LRUMap(cacheSize));
            cacheTTL = ((BaseDirContext) dirContext).getCacheTTL();
            cacheObjectMaxSize = 
                ((BaseDirContext) dirContext).getCacheObjectMaxSize();
        }
    }
    hostName = (String) env.get(HOST);
    contextName = (String) env.get(CONTEXT);
}
项目:ojb    文件:ObjectCacheSoftImpl.java   
/**
 * Construct a new hash map with the specified size
 *
 * @param hardSize the maximum capacity of this map
 */
public SoftHashMap(final int hardSize)
{
    hash = new HashMap();
    hardCacheMap = new LRUMap(hardSize);
    queue = new ReferenceQueue();
}
项目:cacheonix-core    文件:SimpleMRUCache.java   
private void init() {
    cache = new LRUMap( strongReferenceCount );
}
项目:cacheonix-core    文件:SoftLimitMRUCache.java   
private void init() {
    strongReferenceCache = new LRUMap( strongReferenceCount );
}