Known Direct Subclasses
|
Class Overview
The FileCacheBase
is the base class for cached objects that depend on a single file,
that is, the file they depend on cannot be customized through the plug-ins infrastructure,
nor can it internally depend on other configuration files.
It's load method will call the
doLoad(CacheHint)
and save the file's ModificationTime in a table.
When reload is call it will compare the current file's ModificationTime against the value in the table and only
if different will call
load(CacheHint)
again.
Summary
[Expand]
Inherited Constants |
From class
com.microstrategy.utils.cache.CacheBase
int |
DEFAULT_FILE_REFRESH_TIME |
Refresh time constant indicating that default file refreshing time from the CacheRegistry
shall be used for this cache. |
int |
DEFAULT_REFRESH_TIME |
Refresh time constant indicating that default refresh time from the CacheRegistry
shall be used for this cache. |
int |
DEFAULT_STATISTIC_TIME |
Statistic time constant indicating that default statistic time from the CacheRegistry
shall be used for this cache. |
int |
DEFAULT_SYS_TIMEOUT |
|
int |
DEFAULT_USER_TIMEOUT |
Timeout constant indicating that default timeout value from the CacheRegistry
shall be used for this cache. |
int |
NO_REFRESH |
Refresh time constant indicating that cache members are never automatically reloaded. |
int |
NO_STATISTIC |
Statistic time constant indicating that cache shall not automatically log statistic. |
int |
NO_TIMEOUT |
Timeout constant indicating that cache members shall never timeout. |
|
Protected Methods |
abstract
Object
|
doLoad(CacheHint hint)
This abstract method is called by the load method to perform the actual loading.
|
Object
|
getKey(CacheHint hint)
Returns the key of the cache element based on the hint.
|
String
|
getPath(CacheHint hint)
Returns the path for the given hint.
|
Object
|
load(CacheHint hint)
Loads an element from a file and keeps track of its last modification time.
|
Object
|
reLoad(CacheHint hint, Object ob)
Checks if the file corresponding to the hint has changed (by comparing its last modification time
with the value stored by the load method), and if the same, just returns the same object, otherwise
it will call delegate tot he load(CacheHint) method.
|
[Expand]
Inherited Methods |
From class
com.microstrategy.utils.cache.CustomizationsAwareCache
void
|
update(Observable o, Object arg)
When the observer changes, this method simply clears the cache.
|
|
From class
com.microstrategy.utils.cache.CacheBase
boolean
|
canUpdate(CacheHint hint)
Overridable.
|
synchronized
void
|
clear()
Clears the cache - all entries are removed.
|
void
|
close()
Un-register cache from the cache registry.
|
synchronized
void
|
configure(Properties prop)
|
boolean
|
contains(CacheHint hint)
|
void
|
delete(CacheHint hint)
Removes object from the cache and persistent storage
|
Object
|
get(CacheHint hint)
Finds and returns cached object based on the hint.
|
abstract
Object
|
getKey(CacheHint hint)
Overridable.
|
String
|
getName()
Returns cache name.
|
synchronized
int
|
getRefreshTime()
Returns cache refresh time in seconds.
|
synchronized
int
|
getStatisticTime()
Returns the statistic frequency in seconds.
|
synchronized
int
|
getTimeout()
Returns cache timeout in seconds.
|
abstract
Object
|
load(CacheHint hint)
Overridable.
|
void
|
logStatistic()
Writes cache statistic message to the log.
|
void
|
onHintClose(CacheHint hint)
This method is supposed to be called by the hint object when it is closed.
|
void
|
onTimer()
This method is periodically called by the cache registry.
|
void
|
put(CacheHint hint, Object ob)
Puts the object in the cache.
|
Object
|
reLoad(CacheHint hint, Object ob)
Overridable.
|
Object
|
refresh(CacheHint hint)
Re-loads object from the persistent storage
|
void
|
remove(CacheHint hint)
Removes an object from the cache.
|
void
|
save(CacheHint hint, Object ob)
Puts the object in the cache and stores it in the memory.
|
synchronized
void
|
setRefreshTime(int value)
Sets cache refresh time in seconds.
|
synchronized
void
|
setStatisticTime(int value)
Sets the statistic frequency in seconds.
|
synchronized
void
|
setTimeout(int value)
Sets cache timeout in seconds.
|
synchronized
int
|
size()
Returns cache size.
|
void
|
store(CacheHint hint, Object ob)
Overridable.
|
void
|
unLoad(CacheHint hint)
Overridable.
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
com.microstrategy.utils.cache.Cache
abstract
void
|
clear()
Clears the cache - all entries are removed.
|
abstract
void
|
close()
Un-register cache from the cache registry.
|
abstract
boolean
|
contains(CacheHint hint)
|
abstract
void
|
delete(CacheHint hint)
Removes object from the cache and persistent storage
|
abstract
Object
|
get(CacheHint hint)
Finds and returns cached object based on the hint.
|
abstract
String
|
getName()
Returns cache name.
|
abstract
void
|
onHintClose(CacheHint hint)
This method is supposed to be called by the hint object when it is closed.
|
abstract
void
|
put(CacheHint hint, Object ob)
Puts the object in the cache.
|
abstract
Object
|
refresh(CacheHint hint)
Re-loads object from the persistent storage
|
abstract
void
|
remove(CacheHint hint)
Removes an object from the cache.
|
abstract
void
|
save(CacheHint hint, Object ob)
Puts the object in the cache and stores it in the memory.
|
|
From interface
java.util.Observer
abstract
void
|
update(Observable arg0, Object arg1)
|
|
Protected Constructors
protected
FileCacheBase
(String cacheName)
Parameters
cacheName |
The name (id) of the Cache.
|
Protected Methods
protected
abstract
Object
doLoad
(CacheHint hint)
This abstract method is called by the load method to perform the actual loading.
In this method, subclasses needs to load the file and parse it, and return the object
they actually want cached.
protected
Object
getKey
(CacheHint hint)
Returns the key of the cache element based on the hint. In this scenario, the
hint itself is the key.
protected
String
getPath
(CacheHint hint)
Returns the path for the given hint. This implementation simply uses
the hint value.
protected
Object
load
(CacheHint hint)
Loads an element from a file and keeps track of its last modification time. The actual loading
of the element is delegated to the doLoad(CacheHint)
method.
protected
Object
reLoad
(CacheHint hint, Object ob)
Checks if the file corresponding to the hint has changed (by comparing its last modification time
with the value stored by the load method), and if the same, just returns the same object, otherwise
it will call delegate tot he load(CacheHint)
method.