Package org.exoplatform.services.cache
Class ExoCacheConfig
- java.lang.Object
-
- org.exoplatform.services.cache.ExoCacheConfig
-
- All Implemented Interfaces:
Cloneable
public class ExoCacheConfig extends Object implements Cloneable
This class defines the main configuration properties of anExoCache- Since:
- Feb 20, 2005
- Version:
- $Id: ExoCacheConfig.java 5799 2006-05-28 17:55:42Z geaz $
- Author:
- Tuan Nguyen (tuan08@users.sourceforge.net)
- eXo level API
- Platform
-
-
Field Summary
Fields Modifier and Type Field Description booleanavoidValueReplicationDeprecated.
-
Constructor Summary
Constructors Constructor Description ExoCacheConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanavoidValueReplication()ExoCacheConfigclone()CacheModegetCacheMode()StringgetImplementation()Returns the full qualified name of the cache implementation to use.StringgetLabel()Returns the cache labellonggetLiveTime()Returns the amount of time (in seconds) a cache entry is not written or read before it is evictedintgetMaxSize()Returns the maximum amount of entries allowed in the cacheStringgetName()Returns the cache namebooleanisAsync()Indicates if the cache is async or not.booleanisDistributed()Indicates if the cache is distributed or not.booleanisInvalidated()Indicates if the cache is invalidate or not.booleanisLogEnabled()booleanisRepicated()Indicates if the cache is replicated or not.voidsetCacheMode(CacheMode cacheMode)voidsetDistributed(boolean b)Sets distributed statevoidsetImplementation(String alg)Sets the full qualified name of the cache implementation to use.voidsetLabel(String s)Sets the cache labelvoidsetLiveTime(long period)Sets the amount of time (in seconds) a cache entry is not written or read before it is evictedvoidsetLogEnabled(boolean enableLogging)voidsetMaxSize(int size)Sets the maximum amount of entries allowed in the cachevoidsetName(String s)Sets the cache namevoidsetReplicated(boolean b)Sets replicated state
-
-
-
Field Detail
-
avoidValueReplication
@Deprecated public boolean avoidValueReplication
Deprecated.Indicates whether or not the replication of the values should be avoided
-
-
Method Detail
-
getName
public String getName()
Returns the cache name- Returns:
- the cache name
-
setName
public void setName(String s)
Sets the cache name- Parameters:
s- the cache name
-
getLabel
public String getLabel()
Returns the cache label- Returns:
- the cache label
-
setLabel
public void setLabel(String s)
Sets the cache label- Parameters:
s- the cache label
-
getMaxSize
public int getMaxSize()
Returns the maximum amount of entries allowed in the cache- Returns:
- the max size of the cache.
-
setMaxSize
public void setMaxSize(int size)
Sets the maximum amount of entries allowed in the cache- Parameters:
size- the max size of the cache
-
getLiveTime
public long getLiveTime()
Returns the amount of time (in seconds) a cache entry is not written or read before it is evicted- Returns:
- the live time
-
setLiveTime
public void setLiveTime(long period)
Sets the amount of time (in seconds) a cache entry is not written or read before it is evicted- Parameters:
period- the value of the live time
-
isDistributed
public boolean isDistributed()
Indicates if the cache is distributed or not.- Returns:
- flag that indicates if the cache is distributed or not.
-
setDistributed
public void setDistributed(boolean b)
Sets distributed state- Parameters:
b- flag that indicates if the cache is distributed or not.
-
isRepicated
public boolean isRepicated()
Indicates if the cache is replicated or not.- Returns:
- flag that indicates if the cache is repicated or not.
-
setReplicated
public void setReplicated(boolean b)
Sets replicated state- Parameters:
b- flag that indicates if the cache is repicated or not.
-
isAsync
public boolean isAsync()
Indicates if the cache is async or not.- Returns:
- flag that indicates if the cache is async or not.
-
isInvalidated
public boolean isInvalidated()
Indicates if the cache is invalidate or not.- Returns:
- flag that indicates if the cache is invalidate or not.
-
getImplementation
public String getImplementation()
Returns the full qualified name of the cache implementation to use.- Returns:
- the full qualified name
-
setImplementation
public void setImplementation(String alg)
Sets the full qualified name of the cache implementation to use.- Parameters:
alg- the full qualified name of the cache implementation
-
isLogEnabled
public boolean isLogEnabled()
-
setLogEnabled
public void setLogEnabled(boolean enableLogging)
-
avoidValueReplication
public boolean avoidValueReplication()
- Returns:
- the avoidValueReplication (synchronised invalidation)
-
setCacheMode
public void setCacheMode(CacheMode cacheMode)
-
getCacheMode
public CacheMode getCacheMode()
-
clone
public ExoCacheConfig clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException- See Also:
Object.clone()
-
-