EvictionStrategy.java :  » 6.0-JDK-Modules » jsr107 » ri » cache » eviction » Java Open Source

Java Open Source » 6.0 JDK Modules » jsr107 
jsr107 » ri » cache » eviction » EvictionStrategy.java
package ri.cache.eviction;

import javax.cache.CacheEntry;
import javax.cache.Cache;
import java.util.Map;

/**
 * 
 * 
 */
public interface EvictionStrategy<K,V>
    {
    /**
     * 
     * @param key
     * @param value
     * @param ttl
     */
    public CacheEntry<K,V> createEntry(K key, V value, long ttl);
    
    /**
     * 
     * @param entry
     */
    public void discardEntry(CacheEntry<K,V> entry);
    
    /**
     * 
     * @param entry
     */
    public void touchEntry(CacheEntry<K,V> entry);
    
    /**
     * 
     */    
    public void clear();
    
    /**
     * 
     * @param cache
     */
    public Map<K,V> evict(Cache<K,V> cache);
    }
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.