/** * Adds the specified value to the cache under the specified key. Note * that the object is added to both this and the internal cache. * @param key the (non-null) key to store the object under * @param value the (non-null) object to place in the cache * @throws CacheEvictionException exception that the internal cache * would have experienced while evicting an object it currently * cached. */ public void put( Object key, Object value ) throws CacheEvictionException { if ( key == null ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_532 ) ); } else if ( value == null ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_533 ) ); } internal.put( key, value ); removeClearedEntries(); map.put( key, new Entry( key, value, clearQueue ) ); }
/** * Adds the specified value to the cache under the specified key. Note * that the object is added to both this and the internal cache. * @param key the (non-null) key to store the object under * @param value the (non-null) object to place in the cache * @throws CacheEvictionException exception that the internal cache * would have experienced while evicting an object it currently * cached. */ public void put(Object key, Object value) throws CacheEvictionException { if (key == null) { throw new IllegalArgumentException( I18n.err( I18n.ERR_532 ) ); } else if (value == null) { throw new IllegalArgumentException( I18n.err( I18n.ERR_533 ) ); } _internal.put(key, value); removeClearedEntries(); _cacheMap.put(key, new Entry(key, value, _clearQueue)); }
/** * Adds the specified value to the cache under the specified key. Note * that the object is added to both this and the internal cache. * @param key the (non-null) key to store the object under * @param value the (non-null) object to place in the cache * @throws CacheEvictionException exception that the internal cache * would have experienced while evicting an object it currently * cached. */ public void put( Object key, Object value ) throws CacheEvictionException { if ( key == null ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_532 ) ); } else if ( value == null ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_533 ) ); } internal.put( key, value ); removeClearedEntries(); map.put( key, new Entry( key, value, clearQueue ) ); }
removeClearedEntries(); Entry entry = ( Entry ) map.get( key );
removeClearedEntries(); Entry entry = (Entry)_cacheMap.get(key); if (entry == null) { // object is not in cache.
removeClearedEntries(); Entry entry = ( Entry ) map.get( key );