/** * Adds the specified listener to this cache. Note that the events * fired by this correspond to the <em>internal</em> cache's events. * @param listener the (non-null) listener to add to this policy * @throws IllegalArgumentException if listener is null. */ public void addListener( CachePolicyListener listener ) throws IllegalArgumentException { internal.addListener( listener ); }
/** * Gets all the objects stored by the internal (L1) cache. * @return an enumeration of objects in internal cache. */ public Enumeration elements() { return _internal.elements(); }
/** * Removes any object stored under the key specified. Note that the * object is removed from both this (L2) and the internal (L1) * cache. * @param key the key whose object should be removed */ public void remove( Object key ) { map.remove( key ); internal.remove( key ); }
/** * Removes all objects in this (L2) and its internal (L1) cache. */ public void removeAll() { map.clear(); internal.removeAll(); }
/** * 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)); }
/** * Removes a listener that was added earlier. * @param listener the listener to remove. */ public void removeListener( CachePolicyListener listener ) { internal.removeListener( listener ); }
/** * Removes all objects in this (L2) and its internal (L1) cache. */ public void removeAll() { _cacheMap.clear(); _internal.removeAll(); }
/** * 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 ) ); }
/** * Removes a listener that was added earlier. * @param listener the listener to remove. */ public void removeListener( CachePolicyListener listener ) { internal.removeListener( listener ); }
/** * Removes all objects in this (L2) and its internal (L1) cache. */ public void removeAll() { map.clear(); internal.removeAll(); }
/** * Adds the specified listener to this cache. Note that the events * fired by this correspond to the <em>internal</em> cache's events. * @param listener the (non-null) listener to add to this policy * @throws IllegalArgumentException if listener is null. */ public void addListener( CachePolicyListener listener ) throws IllegalArgumentException { internal.addListener( listener ); }
/** * Gets all the objects stored by the internal (L1) cache. * @return an enumeration of objects in internal cache. */ public Enumeration elements() { return internal.elements(); }
/** * Removes any object stored under the key specified. Note that the * object is removed from both this (L2) and the internal (L1) * cache. * @param key the key whose object should be removed */ public void remove(Object key) { _cacheMap.remove(key); _internal.remove(key); }
/** * 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 ) ); }
/** * Removes a listener that was added earlier. * @param listener the listener to remove. */ public void removeListener(CachePolicyListener listener) { _internal.removeListener(listener); }
/** * Rollback (cancel) all changes since beginning of transaction. */ public synchronized void rollback() throws IOException { checkIfClosed(); recMgr.rollback(); // discard all cache entries since we don't know which entries // where part of the transaction cache.removeAll(); }