Package org.exoplatform.services.cache
Class ExoCacheConfig
java.lang.Object
org.exoplatform.services.cache.ExoCacheConfig
- All Implemented Interfaces:
Cloneable
This class defines the main configuration properties of an
ExoCache-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanclone()Returns the full qualified name of the cache implementation to use.getLabel()Returns the cache labellongReturns the amount of time (in seconds) a cache entry is not written or read before it is evictedintReturns the maximum amount of entries allowed in the cachegetName()Returns the cache namebooleanisAsync()Indicates if the cache is async or not.booleanIndicates if the cache is distributed or not.booleanIndicates if the cache is invalidate or not.booleanbooleanIndicates 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.voidSets 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 cachevoidSets the cache namevoidsetReplicated(boolean b) Sets replicated state
-
Field Details
-
avoidValueReplication
Deprecated.Indicates whether or not the replication of the values should be avoided
-
-
Constructor Details
-
ExoCacheConfig
public ExoCacheConfig()
-
-
Method Details
-
getName
Returns the cache name- Returns:
- the cache name
-
setName
Sets the cache name- Parameters:
s- the cache name
-
getLabel
Returns the cache label- Returns:
- the cache label
-
setLabel
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
Returns the full qualified name of the cache implementation to use.- Returns:
- the full qualified name
-
setImplementation
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
-
getCacheMode
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException- See Also:
-