public class CacheConfig extends java.lang.Object implements Configuration
Configuration.Duration, Configuration.ExpiryType
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_BACKUP |
static int |
FLAG_CLUSTER |
static int |
FLAG_GLOBAL |
static int |
FLAG_TRANSIENT |
static int |
FLAG_TRIPLICATE |
static long |
TIME_HOUR |
static long |
TIME_INFINITY |
Constructor and Description |
---|
CacheConfig() |
CacheConfig(Configuration cfg) |
Modifier and Type | Method and Description |
---|---|
long |
getAccessedExpireTimeout()
The maximum time that an item can remain in cache without being referenced.
|
long |
getAccessedExpireTimeoutWindow()
Returns the idle check window, i.e.
|
CacheHandle |
getCache() |
java.lang.Iterable |
getCacheEntryListenerRegistrations() |
HashKey |
getCacheKey()
Returns the globally-unique id for the cache.
|
CacheLoader |
getCacheLoader()
The Cache will use a CacheLoader to populate cache misses.
|
CacheLoaderExt |
getCacheLoaderExt()
The Cache will use a CacheLoader to populate cache misses.
|
CacheWriter |
getCacheWriter() |
CacheWriterExt |
getCacheWriterExt()
The Cache will use a CacheWriter to write-through on puts
|
CacheEngine |
getEngine() |
ExpiryPolicy |
getExpiryPolicy() |
int |
getFlags()
Returns internal flags
|
java.lang.String |
getGuid()
Returns the globally-unique id for the cache.
|
int |
getGuidHash() |
CacheSerializer |
getKeySerializer()
Returns the key serializer
|
long |
getLeaseExpireTimeout()
Returns the lease timeout, which is the time a server can use the local version
if it owns it, before a timeout.
|
long |
getLocalExpireTimeout()
The local read timeout is the time a local copy of the
cache is considered valid without checking the backing store.
|
long |
getModifiedExpireTimeout()
The maximum valid time for an item after a modification.
|
long |
getModifiedExpireTimeoutWindow()
Returns the expire check window, i.e.
|
long |
getReadThroughExpireTimeout() |
ResinCacheBuilder.Scope |
getScopeMode()
Returns the
AbstractCache.Scope defined for this cache. |
int |
getServerIndex() |
IsolationLevel |
getTransactionIsolationLevel() |
Mode |
getTransactionMode() |
CacheSerializer |
getValueSerializer()
Returns the value serializer
|
void |
init()
Initializes the CacheConfig.
|
boolean |
isBackup() |
static boolean |
isBackup(int flags) |
boolean |
isGlobal()
Sets the global mode.
|
static boolean |
isGlobal(int flags) |
boolean |
isReadThrough() |
boolean |
isStatisticsEnabled() |
boolean |
isStoreByValue() |
boolean |
isSynchronousGet()
Returns true if all gets are synchronous, i.e.
|
boolean |
isTransactionsEnabled() |
boolean |
isTriplicate()
Returns true is the triplicate backup mode enabled so that
all triad servers have a copy of the cache item.
|
static boolean |
isTriplicate(int flags) |
boolean |
isWriteThrough() |
void |
setAccessedExpireTimeout(long timeout)
The maximum time that an item can remain in cache without being referenced.
|
void |
setAccessedExpireTimeoutWindow(long idleTimeoutWindow)
Provides the option to set the idle check window, the amount of time
in which the idle time limit can be spread out to smooth performance.
|
void |
setCache(CacheHandle cache)
Sets the globally-unique id for the cache
|
void |
setCacheLoader(CacheLoader cacheLoader)
Sets the CacheLoader that the Cache can then use to
populate cache misses for a reference store (database)
|
void |
setCacheWriter(CacheWriter cacheWriter) |
void |
setEngine(CacheEngine engine) |
void |
setExpiry(Configuration.ExpiryType type,
Configuration.Duration duration) |
void |
setFlags(int flags)
Sets internal flags
|
void |
setGlobal(boolean isGlobal)
Sets the global mode.
|
void |
setGuid(java.lang.String guid)
Sets the globally-unique id for the cache
|
void |
setLeaseExpireTimeout(long timeout)
The lease timeout is the time a server can use the local version
if it owns it, before a timeout.
|
void |
setLocalExpireTimeout(long timeout)
The local expire time is the time a local copy of the
cache is considered valid.
|
void |
setModifiedExpireTimeout(long expireTimeout)
The maximum valid time for an item.
|
void |
setModifiedExpireTimeoutWindow(long expireTimeoutWindow)
Provides the opportunity to control the expire check window,
i.e.
|
void |
setReadThrough(boolean isReadThrough) |
void |
setReadThroughExpireTimeout(long timeout) |
void |
setScopeMode(ResinCacheBuilder.Scope scope)
Sets the
AbstractCache.Scope of this cache. |
void |
setStatisticsEnabled(boolean isEnabled) |
void |
setStoreByValue(boolean isStoreByValue) |
void |
setValueSerializer(CacheSerializer serializer)
Sets the value serializer
|
void |
setWriteThrough(boolean isWriteThrough) |
java.lang.String |
toString() |
public static final long TIME_INFINITY
public static final long TIME_HOUR
public static final int FLAG_TRANSIENT
public static final int FLAG_BACKUP
public static final int FLAG_TRIPLICATE
public static final int FLAG_CLUSTER
public static final int FLAG_GLOBAL
public CacheConfig()
public CacheConfig(Configuration cfg)
public CacheLoader getCacheLoader()
getCacheLoader
in interface Configuration
public CacheLoaderExt getCacheLoaderExt()
public void setCacheLoader(CacheLoader cacheLoader)
public boolean isReadThrough()
isReadThrough
in interface Configuration
public void setReadThrough(boolean isReadThrough)
public long getReadThroughExpireTimeout()
public void setReadThroughExpireTimeout(long timeout)
public CacheWriter getCacheWriter()
getCacheWriter
in interface Configuration
public void setCacheWriter(CacheWriter cacheWriter)
public CacheWriterExt getCacheWriterExt()
public boolean isWriteThrough()
isWriteThrough
in interface Configuration
public void setWriteThrough(boolean isWriteThrough)
public java.lang.String getGuid()
public void setGuid(java.lang.String guid)
public int getGuidHash()
public HashKey getCacheKey()
public void setCache(CacheHandle cache)
public CacheHandle getCache()
public int getFlags()
public void setFlags(int flags)
public long getModifiedExpireTimeout()
@Configurable public void setModifiedExpireTimeout(long expireTimeout)
public long getModifiedExpireTimeoutWindow()
@Configurable public void setModifiedExpireTimeoutWindow(long expireTimeoutWindow)
public long getAccessedExpireTimeout()
public void setAccessedExpireTimeout(long timeout)
public long getAccessedExpireTimeoutWindow()
public void setAccessedExpireTimeoutWindow(long idleTimeoutWindow)
public long getLeaseExpireTimeout()
public void setLeaseExpireTimeout(long timeout)
public long getLocalExpireTimeout()
public void setLocalExpireTimeout(long timeout)
public boolean isSynchronousGet()
public CacheSerializer getKeySerializer()
public CacheSerializer getValueSerializer()
public void setValueSerializer(CacheSerializer serializer)
public boolean isBackup()
public static boolean isBackup(int flags)
public boolean isGlobal()
public static boolean isGlobal(int flags)
public void setGlobal(boolean isGlobal)
public boolean isTriplicate()
public static boolean isTriplicate(int flags)
public void setScopeMode(ResinCacheBuilder.Scope scope)
AbstractCache.Scope
of this cache.public ResinCacheBuilder.Scope getScopeMode()
AbstractCache.Scope
defined for this cache.public void setEngine(CacheEngine engine)
public CacheEngine getEngine()
public int getServerIndex()
public void init()
public void setExpiry(Configuration.ExpiryType type, Configuration.Duration duration)
public boolean isStatisticsEnabled()
isStatisticsEnabled
in interface Configuration
public void setStatisticsEnabled(boolean isEnabled)
public boolean isStoreByValue()
isStoreByValue
in interface Configuration
public void setStoreByValue(boolean isStoreByValue)
public boolean isTransactionsEnabled()
isTransactionsEnabled
in interface Configuration
public IsolationLevel getTransactionIsolationLevel()
getTransactionIsolationLevel
in interface Configuration
public Mode getTransactionMode()
getTransactionMode
in interface Configuration
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Iterable getCacheEntryListenerRegistrations()
getCacheEntryListenerRegistrations
in interface Configuration
public ExpiryPolicy getExpiryPolicy()
getExpiryPolicy
in interface Configuration