Class CacheDefinition
java.lang.Object
io.vertigo.core.node.definition.AbstractDefinition<CacheDefinition>
io.vertigo.datastore.cache.definitions.CacheDefinition
- All Implemented Interfaces:
io.vertigo.core.node.definition.Definition
public final class CacheDefinition
extends io.vertigo.core.node.definition.AbstractDefinition<CacheDefinition>
The cache definition defines the configuration of a cache.
This definition
- has a name;
- and 3 params that define the strategy of caching
- max elements in memory
- time to live
- time to idle
- Author:
- pchretien
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCacheDefinition(String name, boolean serializeElements, int maxElementsInMemory, int timeToLiveSeconds, int timeToIdleSeconds, boolean isReloadedByList) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintintintbooleanbooleanMethods inherited from class io.vertigo.core.node.definition.AbstractDefinition
idMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.vertigo.core.node.definition.Definition
getName
-
Field Details
-
PREFIX
- See Also:
-
-
Constructor Details
-
CacheDefinition
public CacheDefinition(String name, boolean serializeElements, int maxElementsInMemory, int timeToLiveSeconds, int timeToIdleSeconds, boolean isReloadedByList) Constructor.- Parameters:
name- the name of the cacheserializeElements- If elements are serializedmaxElementsInMemory- Max elements stored in memorytimeToLiveSeconds- Time to live (in seconds)timeToIdleSeconds- Time to live when idle (in seconds)
-
-
Method Details
-
shouldSerializeElements
public boolean shouldSerializeElements()- Returns:
- elements should be serialized
-
getMaxElementsInMemory
public int getMaxElementsInMemory()- Returns:
- Max elements stored in memory
-
getTimeToLiveSeconds
public int getTimeToLiveSeconds()- Returns:
- Time to live (in seconds)
-
getTimeToIdleSeconds
public int getTimeToIdleSeconds()- Returns:
- Time tio idle (in seconds)
-
isReloadedByList
public boolean isReloadedByList()
-