|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibatis.sqlmap.engine.cache.CacheModel
public class CacheModel
Wrapper for Caches.
Field Summary | |
---|---|
static Object |
NULL_OBJECT
This is used to represent null objects that are returned from the cache so that they can be cached, too. |
Constructor Summary | |
---|---|
CacheModel()
Default constructor |
Method Summary | |
---|---|
void |
addFlushTriggerStatement(String statementName)
Adds a flushTriggerStatment. |
void |
configure(Properties props)
Configures the cache |
void |
flush()
Clears the cache |
long |
getFlushInterval()
Getter for flushInterval property |
long |
getFlushIntervalSeconds()
Getter for flushInterval property |
Iterator |
getFlushTriggerStatementNames()
Gets an Iterator containing all flushTriggerStatment objects for this cache. |
double |
getHitRatio()
Returns statistical information about the cache. |
String |
getId()
Getter for the cache model's id |
protected int |
getMaxObjectLogSize()
Get the maximum size of an object in the log output. |
Object |
getObject(CacheKey key)
Get an object out of the cache. |
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(String action,
boolean addValue,
Object cacheValue)
Log a cache action. |
void |
onExecuteStatement(MappedStatement statement)
ExecuteListener event. |
void |
putObject(CacheKey key,
Object value)
Add an object to the cache |
void |
setCacheController(CacheController controller)
Sets up the controller for the cache model |
void |
setControllerProperties(Properties cacheProps)
|
void |
setFlushInterval(long flushInterval)
Setter for flushInterval property |
void |
setId(String id)
Setter for the cache model's id |
void |
setReadOnly(boolean readOnly)
Setter for read-only property |
void |
setResource(String resource)
Setter for resource property |
void |
setSerialize(boolean serialize)
Setter to tell the cache to serialize objects |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object NULL_OBJECT
Constructor Detail |
---|
public CacheModel()
Method Detail |
---|
public String getId()
public void setId(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 String getResource()
public void setResource(String resource)
resource
- - the new valuepublic void setCacheController(CacheController controller) throws ClassNotFoundException, InstantiationException, IllegalAccessException
ClassNotFoundException
- - if the class cannot be found
InstantiationException
- - if the class cannot be instantiated
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(String statementName)
statementName
- The statement to add.public Iterator getFlushTriggerStatementNames()
public void onExecuteStatement(MappedStatement statement)
onExecuteStatement
in interface ExecuteListener
statement
- The statement to executepublic double getHitRatio()
public void configure(Properties props)
props
- public void flush()
public Object getObject(CacheKey key)
key
- The key of the object to be returned
public void putObject(CacheKey key, Object value)
key
- The key of the object to be cachedvalue
- The object to be cachedprotected int getMaxObjectLogSize()
protected void log(String action, boolean addValue, Object cacheValue)
action
- String to outputaddValue
- Add the value being cached to the logcacheValue
- The value being loggedpublic void setControllerProperties(Properties cacheProps)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |