|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.configuration.XMLConfiguration
org.osesb.configuration.SimpleCacheConfiguration
public class SimpleCacheConfiguration
Parses a SimpleCache configuration content model in a XML configuration file and sets configurationProperties. Contains convenience methods for accessing SimpleCache properties.
Example SimpleCache configuration content model:<simplecache-configuration>
<!-- SimpleCacheEvictionScanner thread sleep interval -->
<timeBetweenEvictionRunsSeconds>36000</timeBetweenEvictionRunsSeconds>
<!-- The maximum number of cache entries -->
<maxCacheSize>36000</maxCacheSize>
<!-- The CacheEntry field that is used to sort CacheEntrys(s) in evict() -->
<evictionStrategyField>lastAccessedTime</evictionStrategyField>
</simplecache-configuration>
SimpleCache implementations use this configuration to instantiate SimpleCache
objects. Some SimpleCache implementations are in the org.osesb.utilities.cache
package.
The framework uses the following caches to cache objects retrieved from
the XMLRepository:
| Field Summary |
|---|
| Fields inherited from class org.osesb.configuration.XMLConfiguration |
|---|
configFilePath, configurationProperties, constructedFromConfigFile, contentModelElement, ftpClientConfiguration, jaxrpcClientConfiguration, jdbcConfiguration, jmsClientConfiguration, log, rootConfigurationAttributes, smtpClientConfiguration, systemProperties, thisClassName |
| Constructor Summary | |
|---|---|
SimpleCacheConfiguration(org.w3c.dom.Element contentModelElement)
Creates a new instance of SimpleCacheConfiguration given the content model Element. |
|
SimpleCacheConfiguration(java.util.Properties configurationProperties)
Creates a new instance of SimpleCacheConfiguration given the configuration Properties. |
|
SimpleCacheConfiguration(java.lang.String configFile)
Creates a new instance of SimpleCacheConfiguration given a XML configuration file. |
|
SimpleCacheConfiguration(java.lang.String configFile,
java.lang.String xpathExpression)
Creates a new instance of SimpleCacheConfiguration given a XML configuration file and a XPath expression that evaluates to the element that marks the beginning of the configuration. |
|
| Method Summary | |
|---|---|
java.lang.String |
getEvictionStrategyField()
Returns the CacheEntry field that is used to sort CacheEntrys(s) in evict(). |
int |
getMaxCacheSize()
Return the maximum size of the cache |
long |
getTimeBetweenEvictionRunsSeconds()
Return the number of seconds that the SimpleCacheEvictionScanner thread should sleep between "runs". |
static void |
main(java.lang.String[] args)
main() for testing and sandboxing. |
void |
setEvictionStrategyField(java.lang.String evictionStrategyField)
Sets the CacheEntry field that is used to sort CacheEntrys(s) in evict(). |
void |
setMaxCacheSize(int maxCacheSize)
Set the maximum size of the cache. |
void |
setTimeBetweenEvictionRunsSeconds(long timeBetweenEvictionRunsSeconds)
Set the number of seconds that the SimpleCacheEvictionScanner thread should sleep between "runs". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleCacheConfiguration(java.lang.String configFile)
throws java.lang.Exception
configFile - The path to the XML configuration file, which
is specified as a resource path or as a file system
path that is relative to the path specified
by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY
System Property.
java.lang.Exception - if there is a problem reading or parsing the
configuration file.
public SimpleCacheConfiguration(java.lang.String configFile,
java.lang.String xpathExpression)
throws java.lang.Exception
configFile - The path to the XML configuration file, which
is specified as a resource path or as a file system
path that is relative to the path specified
by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY
System Property.xpathExpression - A XPath expression that evaluates to the
element that marks the beginning of the
configuration. If following the framework
convention for SimpleCacheConfiguration(s),
xpathExpression should have 'simplecache-configuration'
as the last Element in the path.
java.lang.Exception - if there is a problem reading or parsing the
configuration file.
public SimpleCacheConfiguration(org.w3c.dom.Element contentModelElement)
throws java.lang.Exception
contentModelElement - The top level Element for the
for the configuration.
java.lang.Exception - if there is a fatal error transversing the
configuration content model enclosed by contentModelElement.public SimpleCacheConfiguration(java.util.Properties configurationProperties)
configurationProperties - Configuration name / value pairs as Properties.| Method Detail |
|---|
public long getTimeBetweenEvictionRunsSeconds()
public void setTimeBetweenEvictionRunsSeconds(long timeBetweenEvictionRunsSeconds)
timeBetweenEvictionRunsSeconds - The number of seconds that the
SimpleCacheEvictionScanner thread should sleep between "runs".public int getMaxCacheSize()
public void setMaxCacheSize(int maxCacheSize)
maxCacheSize - The maximum size of the cache.public java.lang.String getEvictionStrategyField()
public void setEvictionStrategyField(java.lang.String evictionStrategyField)
evictionStrategyField - The CacheEntry field that is used to
sort CacheEntrys(s) in evict().public static void main(java.lang.String[] args)
args - commandline arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||