public class CacheModel
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.Object |
NULL_OBJECT
This is used to represent null objects that are returned from the cache so
that they can be cached, too.
|
| 构造器和说明 |
|---|
CacheModel()
Default constructor
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addFlushTriggerStatement(java.lang.String statementName)
Adds a flushTriggerStatment.
|
void |
configure(java.util.Properties props)
Configures the cache
|
void |
flush()
Clears the cache
|
long |
getFlushInterval()
Getter for flushInterval property
|
long |
getFlushIntervalSeconds()
Getter for flushInterval property
|
java.util.Iterator |
getFlushTriggerStatementNames()
Gets an Iterator containing all flushTriggerStatment objects for this cache.
|
double |
getHitRatio()
Returns statistical information about the cache.
|
java.lang.String |
getId()
Getter for the cache model's id
|
protected int |
getMaxObjectLogSize()
Get the maximum size of an object in the log output.
|
java.lang.Object |
getObject(CacheKey key)
Get an object out of the cache.
|
java.lang.String |
getResource()
Getter for resource property
|
boolean |
isReadOnly()
Getter for read-only property
|
boolean |
isSerialize()
Getter to tell if the cache serializes
|
protected void |
log(java.lang.String action,
boolean addValue,
java.lang.Object cacheValue)
Log a cache action.
|
void |
onExecuteStatement(MappedStatement statement)
ExecuteListener event.
|
void |
putObject(CacheKey key,
java.lang.Object value)
Add an object to the cache
|
void |
setCacheController(CacheControl controller)
Sets up the controller for the cache model
|
void |
setControllerProperties(java.util.Properties cacheProps) |
void |
setFlushInterval(long flushInterval)
Setter for flushInterval property
|
void |
setId(java.lang.String id)
Setter for the cache model's id
|
void |
setReadOnly(boolean readOnly)
Setter for read-only property
|
void |
setResource(java.lang.String resource)
Setter for resource property
|
void |
setSerialize(boolean serialize)
Setter to tell the cache to serialize objects
|
public static final java.lang.Object NULL_OBJECT
public java.lang.String getId()
public void setId(java.lang.String id)
id - - the new idpublic boolean isReadOnly()
public void setReadOnly(boolean readOnly)
readOnly - - the new settingpublic boolean isSerialize()
public void setSerialize(boolean serialize)
serialize - - if the cache model is to serialize objectspublic java.lang.String getResource()
public void setResource(java.lang.String resource)
resource - - the new valuepublic void setCacheController(CacheControl controller) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.ClassNotFoundException - - if the class cannot be foundjava.lang.InstantiationException - - if the class cannot be instantiatedjava.lang.IllegalAccessException - - if the classes constructor is not accessiblepublic long getFlushInterval()
public long getFlushIntervalSeconds()
public void setFlushInterval(long flushInterval)
flushInterval - The new flushInterval (in milliseconds)public void addFlushTriggerStatement(java.lang.String statementName)
statementName - The statement to add.public java.util.Iterator getFlushTriggerStatementNames()
public void onExecuteStatement(MappedStatement statement)
statement - The statement to executepublic double getHitRatio()
public void configure(java.util.Properties props)
props - public void flush()
public java.lang.Object getObject(CacheKey key)
key - The key of the object to be returnedpublic void putObject(CacheKey key, java.lang.Object value)
key - The key of the object to be cachedvalue - The object to be cachedprotected int getMaxObjectLogSize()
protected void log(java.lang.String action,
boolean addValue,
java.lang.Object cacheValue)
action - String to outputaddValue - Add the value being cached to the logcacheValue - The value being loggedpublic void setControllerProperties(java.util.Properties cacheProps)