| |
|
| java.lang.Object com.ibatis.sqlmap.engine.cache.CacheModel
Field Summary | |
final public static Object | NULL_OBJECT This is used to represent null objects that are returned from the cache so
that they can be cached, too. |
NULL_OBJECT | final public static Object NULL_OBJECT(Code) | | This is used to represent null objects that are returned from the cache so
that they can be cached, too.
|
CacheModel | public CacheModel()(Code) | | Default constructor
|
addFlushTriggerStatement | public void addFlushTriggerStatement(String statementName)(Code) | | Adds a flushTriggerStatment. When a flushTriggerStatment is executed, the
cache is flushed (cleared).
Parameters: statementName - The statement to add. |
configure | public void configure(Properties props)(Code) | | Configures the cache
Parameters: props - |
flush | public void flush()(Code) | | Clears the cache
|
getFlushInterval | public long getFlushInterval()(Code) | | Getter for flushInterval property
The flushInterval (in milliseconds) |
getFlushIntervalSeconds | public long getFlushIntervalSeconds()(Code) | | Getter for flushInterval property
The flushInterval (in milliseconds) |
getFlushTriggerStatementNames | public Iterator getFlushTriggerStatementNames()(Code) | | Gets an Iterator containing all flushTriggerStatment objects for this cache.
The Iterator |
getHitRatio | public double getHitRatio()(Code) | | Returns statistical information about the cache.
the number of cache hits divided by the total requests |
getId | public String getId()(Code) | | Getter for the cache model's id
the id |
getMaxObjectLogSize | protected int getMaxObjectLogSize()(Code) | | Get the maximum size of an object in the log output.
Maximum size of a logged object in the output |
getObject | public Object getObject(CacheKey key)(Code) | | Get an object out of the cache.
A side effect of this method is that is may clear the cache if it has not been
cleared in the flushInterval.
Parameters: key - The key of the object to be returned The cached object (or null) |
getResource | public String getResource()(Code) | | Getter for resource property
the value of the resource property |
isReadOnly | public boolean isReadOnly()(Code) | | Getter for read-only property
true if a read-only model |
isSerialize | public boolean isSerialize()(Code) | | Getter to tell if the cache serializes
true if the cache model serializes objects |
log | protected void log(String action, boolean addValue, Object cacheValue)(Code) | | Log a cache action. Since this method is pretty heavy
weight, it's best to enclose it with a log.isDebugEnabled()
when called.
Parameters: action - String to output Parameters: addValue - Add the value being cached to the log Parameters: cacheValue - The value being logged |
onExecuteStatement | public void onExecuteStatement(MappedStatement statement)(Code) | | ExecuteListener event. This will be called by a MappedStatement
for which this cache is registered as a ExecuteListener. It will
be called each time an executeXXXXXX method is called. In the
case of the Cache class, it is registered in order to flush the
cache whenever a certain statement is executed.
(i.e. the flushOnExecute cache policy)
Parameters: statement - The statement to execute |
putObject | public void putObject(CacheKey key, Object value)(Code) | | Add an object to the cache
Parameters: key - The key of the object to be cached Parameters: value - The object to be cached |
setFlushInterval | public void setFlushInterval(long flushInterval)(Code) | | Setter for flushInterval property
Parameters: flushInterval - The new flushInterval (in milliseconds) |
setId | public void setId(String id)(Code) | | Setter for the cache model's id
Parameters: id - - the new id |
setReadOnly | public void setReadOnly(boolean readOnly)(Code) | | Setter for read-only property
Parameters: readOnly - - the new setting |
setResource | public void setResource(String resource)(Code) | | Setter for resource property
Parameters: resource - - the new value |
setSerialize | public void setSerialize(boolean serialize)(Code) | | Setter to tell the cache to serialize objects
Parameters: serialize - - if the cache model is to serialize objects |
|
|
|