org.riotfamily.cachius
Class CacheFactory

java.lang.Object
  extended by org.riotfamily.cachius.CacheFactory
Direct Known Subclasses:
CacheFactoryBean

public class CacheFactory
extends Object

Since:
6.5
Author:
Felix Gnass [fgnass at neteye dot de]

Field Summary
static String DEFAULT_CACHE_DIR_NAME
           
static int DEFAULT_CAPACITY
           
 
Constructor Summary
CacheFactory()
           
 
Method Summary
 Cache createInstance()
           
protected  Cache deserialize(File f)
           
protected  File getCacheDir()
           
 boolean isRestore()
           
protected  void persist(Cache cache)
           
 void setCacheDir(File cacheDir)
           
 void setCapacity(int capacity)
          Sets the capacity of the Cache.
 void setEnabled(boolean enabled)
           
 void setRestore(boolean restore)
          Sets whether the factory should try to restore a previously persisted version of the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CAPACITY

public static final int DEFAULT_CAPACITY
See Also:
Constant Field Values

DEFAULT_CACHE_DIR_NAME

public static final String DEFAULT_CACHE_DIR_NAME
See Also:
Constant Field Values
Constructor Detail

CacheFactory

public CacheFactory()
Method Detail

setCapacity

public void setCapacity(int capacity)
Sets the capacity of the Cache. If not set, the capacity will default to DEFAULT_CAPACITY (10000).


setCacheDir

public void setCacheDir(File cacheDir)

getCacheDir

protected File getCacheDir()

setRestore

public void setRestore(boolean restore)
Sets whether the factory should try to restore a previously persisted version of the cache. Default is true.


isRestore

public boolean isRestore()

setEnabled

public void setEnabled(boolean enabled)

createInstance

public Cache createInstance()
                     throws Exception
Throws:
Exception

persist

protected void persist(Cache cache)

deserialize

protected Cache deserialize(File f)