|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.ehcache.config.CacheConfiguration
public class CacheConfiguration
A value object to represent Cache configuration that can be set by the BeanHandler.
e.g.
Nested Class Summary | |
---|---|
class |
CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration
Configuration for the BootstrapCacheLoaderFactoryConfiguration. |
class |
CacheConfiguration.CacheEventListenerFactoryConfiguration
Configuration for the CachePeerListenerFactoryConfiguration. |
class |
CacheConfiguration.CacheExceptionHandlerFactoryConfiguration
Configuration for the BootstrapCacheLoaderFactoryConfiguration. |
class |
CacheConfiguration.CacheExtensionFactoryConfiguration
Configuration for the CacheExtensionFactoryConfiguration. |
class |
CacheConfiguration.CacheLoaderFactoryConfiguration
Configuration for the CacheLoaderFactoryConfiguration. |
Field Summary | |
---|---|
protected CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration |
bootstrapCacheLoaderFactoryConfiguration
The BootstrapCacheLoaderFactoryConfiguration. |
protected java.util.List<CacheConfiguration.CacheEventListenerFactoryConfiguration> |
cacheEventListenerConfigurations
The event listener factories added by BeanUtils. |
protected CacheConfiguration.CacheExceptionHandlerFactoryConfiguration |
cacheExceptionHandlerFactoryConfiguration
The CacheExceptionHandlerFactoryConfiguration. |
protected java.util.List<CacheConfiguration.CacheExtensionFactoryConfiguration> |
cacheExtensionConfigurations
The cache extension factories added by BeanUtils. |
protected java.util.List |
cacheLoaderConfigurations
The cache loader factories added by BeanUtils. |
protected boolean |
clearOnFlush
Sets whether the MemoryStore should be cleared when flush() is called on the cache - true by default. |
protected long |
diskExpiryThreadIntervalSeconds
The interval in seconds between runs of the disk expiry thread. |
protected boolean |
diskPersistent
For caches that overflow to disk, whether the disk cache persists between CacheManager instances. |
protected int |
diskSpoolBufferSizeMB
The size of the disk spool used to buffer writes |
protected boolean |
eternal
Sets whether elements are eternal. |
protected int |
maxElementsInMemory
the maximum objects to be held in the MemoryStore . |
protected int |
maxElementsOnDisk
the maximum objects to be held in the DiskStore . |
protected MemoryStoreEvictionPolicy |
memoryStoreEvictionPolicy
The policy used to evict elements from the MemoryStore . |
protected java.lang.String |
name
the name of the cache. |
protected boolean |
overflowToDisk
whether elements can overflow to disk when the in-memory cache has reached the set limit. |
protected TerracottaConfiguration |
terracottaConfiguration
The TerracottaConfiguration. |
protected long |
timeToIdleSeconds
the time to idle for an element before it expires. |
protected long |
timeToLiveSeconds
Sets the time to idle for an element before it expires. |
Constructor Summary | |
---|---|
CacheConfiguration()
|
Method Summary | |
---|---|
void |
addBootstrapCacheLoaderFactory(CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration bootstrapCacheLoaderFactoryConfiguration)
Allows BeanHandler to add the CacheManagerEventListener to the configuration. |
void |
addCacheEventListenerFactory(CacheConfiguration.CacheEventListenerFactoryConfiguration factory)
Used by BeanUtils to add cacheEventListenerFactory elements to the cache configuration. |
void |
addCacheExceptionHandlerFactory(CacheConfiguration.CacheExceptionHandlerFactoryConfiguration cacheExceptionHandlerFactoryConfiguration)
Allows BeanHandler to add the CacheExceptionHandlerFactory to the configuration. |
void |
addCacheExtensionFactory(CacheConfiguration.CacheExtensionFactoryConfiguration factory)
Used by BeanUtils to add cacheExtensionFactory elements to the cache configuration. |
void |
addCacheLoaderFactory(CacheConfiguration.CacheLoaderFactoryConfiguration factory)
Used by BeanUtils to add each cacheLoaderFactory to the cache configuration. |
void |
addTerracotta(TerracottaConfiguration terracottaConfiguration)
Allows BeanHandler to add the TerracottaConfiguration to the configuration. |
CacheConfiguration |
clone()
Clones this object, following the usual contract. |
CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration |
getBootstrapCacheLoaderFactoryConfiguration()
Accessor |
java.util.List |
getCacheEventListenerConfigurations()
Accessor |
CacheConfiguration.CacheExceptionHandlerFactoryConfiguration |
getCacheExceptionHandlerFactoryConfiguration()
Accessor |
java.util.List |
getCacheExtensionConfigurations()
Accessor |
java.util.List |
getCacheLoaderConfigurations()
Accessor |
long |
getDiskExpiryThreadIntervalSeconds()
Accessor |
int |
getDiskSpoolBufferSizeMB()
Getter |
int |
getMaxElementsInMemory()
Accessor |
int |
getMaxElementsOnDisk()
Accessor |
MemoryStoreEvictionPolicy |
getMemoryStoreEvictionPolicy()
Accessor |
java.lang.String |
getName()
Accessor |
TerracottaConfiguration |
getTerracottaConfiguration()
Accessor |
long |
getTimeToIdleSeconds()
Accessor |
long |
getTimeToLiveSeconds()
Accessor |
boolean |
isClearOnFlush()
Accessor |
boolean |
isDiskPersistent()
Accessor |
boolean |
isEternal()
Accessor |
boolean |
isOverflowToDisk()
Accessor |
boolean |
isTerracottaClustered()
Helper method to compute whether the cache is clustered or not |
void |
setClearOnFlush(boolean clearOnFlush)
Sets whether the MemoryStore should be cleared when flush() is called on the cache - true by default. |
void |
setDiskExpiryThreadIntervalSeconds(long diskExpiryThreadIntervalSeconds)
Sets the interval in seconds between runs of the disk expiry thread. |
void |
setDiskPersistent(boolean diskPersistent)
Sets whether, for caches that overflow to disk, the disk cache persist between CacheManager instances. |
void |
setDiskSpoolBufferSizeMB(int diskSpoolBufferSizeMB)
Sets the disk spool size |
void |
setEternal(boolean eternal)
Sets whether elements are eternal. |
void |
setMaxElementsInMemory(int maxElementsInMemory)
Sets the maximum objects to be held in memory. |
void |
setMaxElementsOnDisk(int maxElementsOnDisk)
Sets the maximum number elements on Disk. |
void |
setMemoryStoreEvictionPolicy(java.lang.String memoryStoreEvictionPolicy)
Sets the eviction policy. |
void |
setMemoryStoreEvictionPolicyFromObject(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy)
Sets the eviction policy. |
void |
setName(java.lang.String name)
Sets the name of the cache. |
void |
setOverflowToDisk(boolean overflowToDisk)
Sets whether elements can overflow to disk when the in-memory cache has reached the set limit. |
void |
setTimeToIdleSeconds(long timeToIdleSeconds)
Sets the time to idle for an element before it expires. |
void |
setTimeToLiveSeconds(long timeToLiveSeconds)
Sets the time to idle for an element before it expires. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected int maxElementsInMemory
MemoryStore
.
protected int maxElementsOnDisk
DiskStore
.
protected MemoryStoreEvictionPolicy memoryStoreEvictionPolicy
MemoryStore
.
This can be one of:
protected boolean clearOnFlush
flush()
is called on the cache - true by default.
protected boolean eternal
protected long timeToIdleSeconds
protected long timeToLiveSeconds
protected boolean overflowToDisk
protected boolean diskPersistent
protected int diskSpoolBufferSizeMB
protected long diskExpiryThreadIntervalSeconds
protected final java.util.List<CacheConfiguration.CacheEventListenerFactoryConfiguration> cacheEventListenerConfigurations
protected final java.util.List<CacheConfiguration.CacheExtensionFactoryConfiguration> cacheExtensionConfigurations
protected CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration bootstrapCacheLoaderFactoryConfiguration
protected CacheConfiguration.CacheExceptionHandlerFactoryConfiguration cacheExceptionHandlerFactoryConfiguration
protected TerracottaConfiguration terracottaConfiguration
protected java.util.List cacheLoaderConfigurations
Constructor Detail |
---|
public CacheConfiguration()
Method Detail |
---|
public CacheConfiguration clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public final void setName(java.lang.String name)
name
- the cache namepublic final void setMaxElementsInMemory(int maxElementsInMemory)
maxElementsInMemory
- parampublic final void setMemoryStoreEvictionPolicy(java.lang.String memoryStoreEvictionPolicy)
memoryStoreEvictionPolicy
- a String representation of the policy. One of "LRU", "LFU" or "FIFO".public final void setMemoryStoreEvictionPolicyFromObject(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy)
public final void setClearOnFlush(boolean clearOnFlush)
flush()
is called on the cache - true by default.
public final void setEternal(boolean eternal)
public final void setTimeToIdleSeconds(long timeToIdleSeconds)
public final void setTimeToLiveSeconds(long timeToLiveSeconds)
public final void setOverflowToDisk(boolean overflowToDisk)
public final void setDiskPersistent(boolean diskPersistent)
public int getDiskSpoolBufferSizeMB()
public void setDiskSpoolBufferSizeMB(int diskSpoolBufferSizeMB)
diskSpoolBufferSizeMB
- a postive numberpublic void setMaxElementsOnDisk(int maxElementsOnDisk)
public final void setDiskExpiryThreadIntervalSeconds(long diskExpiryThreadIntervalSeconds)
public final void addCacheEventListenerFactory(CacheConfiguration.CacheEventListenerFactoryConfiguration factory)
public final void addCacheExtensionFactory(CacheConfiguration.CacheExtensionFactoryConfiguration factory)
public final void addBootstrapCacheLoaderFactory(CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration bootstrapCacheLoaderFactoryConfiguration)
public final void addCacheExceptionHandlerFactory(CacheConfiguration.CacheExceptionHandlerFactoryConfiguration cacheExceptionHandlerFactoryConfiguration)
public final void addCacheLoaderFactory(CacheConfiguration.CacheLoaderFactoryConfiguration factory)
factory
- public final void addTerracotta(TerracottaConfiguration terracottaConfiguration)
terracottaConfiguration
- public java.lang.String getName()
public int getMaxElementsInMemory()
public int getMaxElementsOnDisk()
public MemoryStoreEvictionPolicy getMemoryStoreEvictionPolicy()
public boolean isClearOnFlush()
public boolean isEternal()
public long getTimeToIdleSeconds()
public long getTimeToLiveSeconds()
public boolean isOverflowToDisk()
public boolean isDiskPersistent()
public long getDiskExpiryThreadIntervalSeconds()
public java.util.List getCacheEventListenerConfigurations()
public java.util.List getCacheExtensionConfigurations()
public java.util.List getCacheLoaderConfigurations()
public CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration getBootstrapCacheLoaderFactoryConfiguration()
public CacheConfiguration.CacheExceptionHandlerFactoryConfiguration getCacheExceptionHandlerFactoryConfiguration()
public TerracottaConfiguration getTerracottaConfiguration()
public boolean isTerracottaClustered()
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |