public ConcurrentHashMapImpl() { c = new ConcurrentHashMap(); }
/** * Expires Items in need of expiration. */ protected void expireItems() { //Sort the entries in the cache. final List entries = new LinkedList(new ConcurrentHashMap(managedCache).entrySet()); CollectionUtils.filter(entries, new ExpirationTimePredicate(currentTime)); final Object[] args = { new Integer(entries.size()) }; log.debug(Messages.getCompoundString("CacheDecorator.expiration_count", args)); //$NON-NLS-1$ for (final Iterator i = entries.iterator(); i.hasNext();) { final Map.Entry entry = (Entry) i.next(); if (entry != null) { //log.trace("Removing: " + entry.getKey()); managedCache.remove(entry.getKey()); } } }
log.debug( Messages.getCompoundString("CacheMaintenancePolicy.clearing_approximately", args1) ); //$NON-NLS-1$ final List entries = new ArrayList( new ConcurrentHashMap( managedCache ).entrySet() ); Collections.sort( entries, new CountComparator() ); final List removeThese = entries.subList( 0, currentSize - maxSize );
private static Map getClassLoaderCache(ClassLoader cl) { synchronized(classloaderCache) { Map result = (Map) classloaderCache.get(cl); if (result == null) { result = new ConcurrentHashMap(); classloaderCache.put(cl, result); } return result; } } }
public Diff( ){ modifiedFeatures=new ConcurrentHashMap(); addedFeatures=new ConcurrentHashMap(); modified2=Collections.unmodifiableMap(modifiedFeatures); added=Collections.unmodifiableMap(addedFeatures); spatialIndex=new Quadtree(); mutex=this; }
Map clientsClone = new ConcurrentHashMap(clients); Map requestClients = new ConcurrentHashMap(); requestClients.put(ClientHolder.CLIENT_HOLDER_KEY, clientsClone);