~ubuntu-branches/ubuntu/trusty/ehcache/trusty

« back to all changes in this revision

Viewing changes to net/sf/ehcache/store/MemoryStore.java

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2008-07-14 02:08:53 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080714020853-37uz6uzh6mc5mcgx
Tags: 1.5.0-1
* New upstream release
* Add libjgroups-java to Build-Depends-Indep
* Bump Standards-Version to 3.8.0
* debian/copyright: remove the full text of Apache 2.0 license, as now
  is included in common licenses

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 * policies (e.g: FIFO, LFU, LRU, etc.) should extend this class.
32
32
 *
33
33
 * @author <a href="mailto:ssuravarapu@users.sourceforge.net">Surya Suravarapu</a>
34
 
 * @version $Id: MemoryStore.java 519 2007-07-27 07:11:45Z gregluck $
 
34
 * @version $Id: MemoryStore.java 608 2008-05-04 03:32:51Z gregluck $
35
35
 */
36
36
public abstract class MemoryStore implements Store {
37
37
 
141
141
    }
142
142
 
143
143
    /**
144
 
     * Gets an item from the cache, without updating Element statistics.
 
144
     * Gets an item from the cache, without updating statistics.
145
145
     *
146
146
     * @param key the cache key
147
147
     * @return the element, or null if there was no match for the key
210
210
    }
211
211
 
212
212
    /**
213
 
     * Flush to disk.
 
213
     * Flush to disk only if the cache is diskPersistent.
214
214
     */
215
215
    public final synchronized void flush() {
216
 
        if (cache.isOverflowToDisk()) {
 
216
        if (cache.isDiskPersistent()) {
217
217
            if (LOG.isDebugEnabled()) {
218
218
                LOG.debug(cache.getName() + " is persistent. Spooling " + map.size() + " elements to the disk store.");
219
219
            }
220
220
            spoolAllToDisk();
221
 
            //should be empty in any case
222
 
            clear();
223
221
        }
 
222
        //should be emptied in any case
 
223
        clear();
224
224
    }
225
225
 
226
226
    /**