|Managing the Repository / Managing the Repository Cache|
The repository cache exposed through JMX allows you to check the cache status, clear all or remove specific cached resources, modify the cache configuration, and monitor the resource in the cache.
Since the repository cache is exposed through JMX, you can use any tool that is used to manage or monitor JMX. Included with Spectrum are two tools: JMX Console and JConsole.
Accessing the repository cache using the Spectrum JMX Console:
Accessing the repository cache using the JConsole:
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9127 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
Capacity - This is the number of resources cached by the remote component at any given time. If the capacity is modified, the current resource cache will be cleared, and a new one created. As the capacity is reached, older resources in the cache are removed to make room for newer resources. It is important to remember, if a resource is cached that uses other resources (e.g., a named map uses multiple named tables), both that resource and all resources used are also cached.
Expire - This is the expiry time in milliseconds. If the cache policy is set to 2 (check with expire), this value is used as the interval to check for updating the resource when trying to be accessed.
Update Check Policy - This is the way resources in the cache will be checked to see if they need to be updated with the latest version in the repository. The policy values are 0, 1, or 2. Where 0=Never, 1=Always, and 2=Check with Expire. Never checking the resource cache means that no checking for resource updating is done. Cached resources can be removed through JMX manually if they are changed in the repository and you need to modify the cache. Always checking the resource cache means that every time a resource is required from the cache, it will check if the cached resource is the same as in the repository. If the resource has changed, a new one will be loaded into the cache. Checking with expiry will only check resources in the cache for updating if the expire time since the last check has been exceeded. The expire time is the value defined in the expire property. This value is in milliseconds.
Remove Resources - This is used to remove specified resources from the cache. Enter the directory structure from the repository you would like to remove from the cache starting at the root. Usually used when you have the policy set to Never and you are updating resources in the repository, this allows you to clear the older resource definitions from the cache, so the next time the resource is accessed, it will be updated in the cache using the new definition. The wildcard character * can be used at the end of a path to remove all resources within a directory or subdirectories. For example, if you would like to remove all resources within the samples directory, enter /samples/*.
Clear Cache - This is used to clear the entire cache. This will also reset all counts in the monitored statistics.
List Cache Resource Names - This is used to return all of the resource paths within the cache. If you are removing resources manually from the cache using JMX, it is good practice to first list all the cached resources first, to get an accurate list of cache paths to remove. To get the list, use JConsole instead of JMX.