/** * 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 ) ); }
/** * 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 ) ); }
_internal.put(key, value); } catch (CacheEvictionException e) {
internal.put( key, value );
internal.put( key, value );
cache.put( recid, new CacheEntry( recid, obj, serializer, true ) );
cache.put( recid, new CacheEntry( recid, obj, serializer, true ) );
cache.put( recid, new CacheEntry( recid, obj, serializer, true ) );
/** * Inserts a new record using a custom serializer. * * @param obj the object for the new record. * @param serializer a custom serializer * @return the rowid for the new record. * @throws IOException when one of the underlying I/O operations fails. */ public synchronized long insert( Object obj, Serializer serializer ) throws IOException { checkIfClosed(); long recid = recordManager.insert( obj, serializer ); try { cache.put( recid, new CacheEntry( recid, obj, serializer, false ) ); } catch ( CacheEvictionException except ) { throw new WrappedRuntimeException( except ); } return recid; }
/** * Inserts a new record using a custom serializer. * * @param obj the object for the new record. * @param serializer a custom serializer * @return the rowid for the new record. * @throws IOException when one of the underlying I/O operations fails. */ public synchronized long insert( Object obj, Serializer serializer ) throws IOException { checkIfClosed(); long recid = recMgr.insert( obj, serializer ); try { cache.put( recid, new CacheEntry( recid, obj, serializer, false ) ); } catch ( CacheEvictionException except ) { throw new WrappedRuntimeException( except ); } return recid; }
/** * Inserts a new record using a custom serializer. * * @param obj the object for the new record. * @param serializer a custom serializer * @return the rowid for the new record. * @throws IOException when one of the underlying I/O operations fails. */ public synchronized long insert( Object obj, Serializer serializer ) throws IOException { checkIfClosed(); long recid = recordManager.insert( obj, serializer ); try { cache.put( recid, new CacheEntry( recid, obj, serializer, false ) ); } catch ( CacheEvictionException except ) { throw new WrappedRuntimeException( except ); } return recid; }
cache.put( recid, entry );
try cache.put( recid, entry );
cache.put( recid, entry );