/** * 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); }
/** * 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(); }
private void init() { cache = new LRUMap( strongReferenceCount ); }
private void init() { strongReferenceCache = new LRUMap( strongReferenceCount ); }