org.xwiki.cache.eviction
Class EntryEvictionConfiguration

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,java.lang.Object>
          extended by org.xwiki.cache.eviction.EntryEvictionConfiguration
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>
Direct Known Subclasses:
LRUEvictionConfiguration

public class EntryEvictionConfiguration
extends java.util.HashMap<java.lang.String,java.lang.Object>

This configuration class is used to add constraints in the configuration of the cache to create.

CacheFactory factory = (CacheFactory) getComponentManager().lookup(CacheFactory.class, this.roleHint); CacheConfiguration conf = new CacheConfiguration(); LRUEvictionConfiguration lec = new LRUEvictionConfiguration(); lec.setMaxEntries(1); conf.put(LRUEvictionConfiguration.CONFIGURATIONID, lec);

Version:
$Id$
See Also:
Serialized Form

Nested Class Summary
static class EntryEvictionConfiguration.Algorithm
          The ordering/storing algorithm used by the cache.
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
static java.lang.String CONFIGURATIONID
          The key use to access eviction configuration in the CacheConfiguration.
static java.lang.String TIMETOLIVE_ID
          The key used to access time to live duration in the EntryEvictionConfiguration.
 
Constructor Summary
EntryEvictionConfiguration()
           
 
Method Summary
 EntryEvictionConfiguration.Algorithm getAlgorithm()
           
 int getTimeToLive()
           
 void setAlgotithm(EntryEvictionConfiguration.Algorithm mode)
           
 void setTimeToLive(int timeToLive)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

CONFIGURATIONID

public static final java.lang.String CONFIGURATIONID
The key use to access eviction configuration in the CacheConfiguration.

See Also:
Constant Field Values

TIMETOLIVE_ID

public static final java.lang.String TIMETOLIVE_ID
The key used to access time to live duration in the EntryEvictionConfiguration.

See Also:
Constant Field Values
Constructor Detail

EntryEvictionConfiguration

public EntryEvictionConfiguration()
Method Detail

setAlgotithm

public void setAlgotithm(EntryEvictionConfiguration.Algorithm mode)
Parameters:
mode - the ordering/storing algorithm used by the cache.

getAlgorithm

public EntryEvictionConfiguration.Algorithm getAlgorithm()
Returns:
the ordering/storing algorithm used by the cache.

setTimeToLive

public void setTimeToLive(int timeToLive)
Parameters:
timeToLive - the maximum time to live in seconds of a cache entry.

getTimeToLive

public int getTimeToLive()
Returns:
the maximum time to live in seconds of a cache entry.


Copyright © 2004-2011 XWiki. All Rights Reserved.