org.infinispan.config
Class CacheLoaderManagerConfig
java.lang.Object
org.infinispan.config.AbstractConfigurationBean
org.infinispan.config.AbstractNamedCacheConfigurationBean
org.infinispan.config.CacheLoaderManagerConfig
- All Implemented Interfaces:
- Serializable, Cloneable, CloneableConfigurationComponent, Configuration.LoadersConfig, JAXBUnmarshallable
public class CacheLoaderManagerConfig
- extends AbstractNamedCacheConfigurationBean
- implements Configuration.LoadersConfig
Holds the configuration of the cache loader chain. All cache loaders should be defined using this
class, adding individual cache loaders to the chain by calling
addCacheLoaderConfig(org.infinispan.loaders.CacheLoaderConfig)
- Since:
- 4.0
- Author:
- Manik Surtani (manik@jboss.org), Brian Stansberry, Vladimir Blagojevic, Galder Zamarreno
- See Also:
- Configuration reference,
Serialized Form
passivation
protected Boolean passivation
preload
protected Boolean preload
shared
protected Boolean shared
cacheLoaderConfigs
protected List<CacheLoaderConfig> cacheLoaderConfigs
CacheLoaderManagerConfig
public CacheLoaderManagerConfig()
CacheLoaderManagerConfig
public CacheLoaderManagerConfig(CacheLoaderConfig clc)
isPreload
public Boolean isPreload()
preload
public Configuration.LoadersConfig preload(Boolean preload)
- If true, when the cache starts, data stored in the cache store will be pre-loaded into memory.
This is particularly useful when data in the cache store will be needed immediately after
startup and you want to avoid cache operations being delayed as a result of loading this data
lazily. Can be used to provide a 'warm-cache' on startup, however there is a performance
penalty as startup time is affected by this process.
- Specified by:
preload
in interface Configuration.LoadersConfig
- Parameters:
preload
-
setPreload
public void setPreload(Boolean preload)
passivation
public Configuration.LoadersConfig passivation(Boolean passivation)
- If true, data is only written to the cache store when it is evicted from memory, a phenomenon
known as 'passivation'. Next time the data is requested, it will be 'activated' which means
that data will be brought back to memory and removed from the persistent store. This gives you
the ability to 'overflow' to disk, similar to swapping in an operating system.
If false, the cache store contains a copy of the contents in memory, so writes to cache result
in cache store writes. This essentially gives you a 'write-through' configuration.
- Specified by:
passivation
in interface Configuration.LoadersConfig
- Parameters:
passivation
-
setPassivation
public void setPassivation(Boolean passivation)
isPassivation
public Boolean isPassivation()
shared
public Configuration.LoadersConfig shared(Boolean shared)
- This setting should be set to true when multiple cache instances share the same cache store
(e.g., multiple nodes in a cluster using a JDBC-based CacheStore pointing to the same, shared
database.) Setting this to true avoids multiple cache instances writing the same modification
multiple times. If enabled, only the node where the modification originated will write to the
cache store.
If disabled, each individual cache reacts to a potential remote update by storing the data to
the cache store. Note that this could be useful if each individual node has its own cache
store - perhaps local on-disk.
- Specified by:
shared
in interface Configuration.LoadersConfig
- Parameters:
shared
-
setShared
public void setShared(Boolean shared)
isShared
public Boolean isShared()
addCacheLoaderConfig
public Configuration.LoadersConfig addCacheLoaderConfig(CacheLoaderConfig clc)
- Specified by:
addCacheLoaderConfig
in interface Configuration.LoadersConfig
getCacheLoaderConfigs
public List<CacheLoaderConfig> getCacheLoaderConfigs()
setCacheLoaderConfigs
public Configuration.LoadersConfig setCacheLoaderConfigs(List<CacheLoaderConfig> configs)
- Specified by:
setCacheLoaderConfigs
in interface Configuration.LoadersConfig
getFirstCacheLoaderConfig
public CacheLoaderConfig getFirstCacheLoaderConfig()
isFetchPersistentState
public Boolean isFetchPersistentState()
- Loops through all individual cache loader configs and checks if fetchPersistentState is set on
any of them
useChainingCacheLoader
public boolean useChainingCacheLoader()
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
accept
public void accept(ConfigurationBeanVisitor v)
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
clone
public CacheLoaderManagerConfig clone()
throws CloneNotSupportedException
- Specified by:
clone
in interface CloneableConfigurationComponent
- Overrides:
clone
in class AbstractNamedCacheConfigurationBean
- Throws:
CloneNotSupportedException
Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.