com.ibatis.sqlmap.engine.cache
public class CacheModel extends Object implements ExecuteListener
| 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
|
Parameters: statementName The statement to add.
Parameters: props
Returns: The flushInterval (in milliseconds)
Returns: The flushInterval (in milliseconds)
Returns: The Iterator
Returns: the number of cache hits divided by the total requests
Returns: the id
Returns: Maximum size of a logged object in the output
Parameters: key The key of the object to be returned
Returns: The cached object (or null)
Returns: the value of the resource property
Returns: true if a read-only model
Returns: true if the cache model serializes objects
Parameters: action String to output addValue Add the value being cached to the log cacheValue The value being logged
Parameters: statement The statement to execute
Parameters: key The key of the object to be cached value The object to be cached
Throws: ClassNotFoundException - if the class cannot be found InstantiationException - if the class cannot be instantiated IllegalAccessException - if the classes constructor is not accessible
Parameters: flushInterval The new flushInterval (in milliseconds)
Parameters: id - the new id
Parameters: readOnly - the new setting
Parameters: resource - the new value
Parameters: serialize - if the cache model is to serialize objects