Class ResourceCacheManager
- java.lang.Object
 - 
- com.microstrategy.web.app.utils.cache.ResourceCacheManager
 
 
- 
public class ResourceCacheManager extends java.lang.ObjectTheResourceCacheManageris basically a wrapper of theResourceCache. It provides helper methods to accessResourceobjects without having to catch CacheException or to create CacheHints on the fly. Copyright © 2002 MicroStrategy, Inc.- Since:
 - MicroStrategy Web 7.5.1
 - See Also:
 ResourceCache
 
- 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.ObjectgetCachedObject(java.lang.String key)Deprecated.This class should only be used to access Resources.FileLoadergetFileLoader()Deprecated.FileLoader usage is now recommended as a singleton.static ResourceCacheManagergetInstance()Returns the instance of the ResourceCacheManager classResourcegetResourceObject(java.lang.String filePath)Obtains the cached object held by theResourceCachemapping tableResourcegetResourceObject(java.lang.String filePath, java.lang.String encode, java.lang.String localeID)Obtains the cached object held by theResourceCachemapping tableorg.w3c.dom.DocumentgetResourceObjectDocument(java.lang.String filePath)Obtains the DOM Document contents of the cached object held by theResourceCachemapping table.org.w3c.dom.DocumentgetResourceObjectDocument(java.lang.String filePath, java.lang.String encode, java.lang.String localeID)Obtains the DOM Document contents of the cached object held by theResourceCachemapping table.java.lang.StringgetResourceObjectString(java.lang.String filePath)Obtains the string contents of the cached object held by theResourceCachemapping tablejava.lang.StringgetResourceObjectString(java.lang.String filePath, java.lang.String encode, java.lang.String localeID)Obtains the string contents of the cached object held by theResourceCachemapping tablevoidinit(FileLoader fileLoader)Deprecated.FileLoader usage is now recommended as a singleton.voidstoreObjectToCache(java.lang.String key, java.lang.Object resourceObject)Deprecated.Should not be called explicitly.voidstoreResourceObject(java.lang.String key, java.lang.Object resourceObject)Deprecated.Should not be called explicitly.voidstoreResourceObject(java.lang.String key, java.lang.String encode, java.lang.String localeID, java.lang.Object resourceObject)Deprecated.Should not be called explicitly. 
 - 
 
- 
- 
Method Detail
- 
getInstance
public static ResourceCacheManager getInstance()
Returns the instance of the ResourceCacheManager class- Returns:
 - the 
ResourceCacheManagerinstance 
 
- 
init
public void init(FileLoader fileLoader)
Deprecated.FileLoader usage is now recommended as a singleton. The FileLoader should now always be accessed by:FileLoader.getInstance();Initializes theResourceCacheobject with the FileLoader to use.
This method has been deprecated. The FileLoader is now moved to a singleton pattern, therefore now it might be accessed by:FileLoader.getInstance();, so this method should not be called explicitly, as theFileLoaderprovided might not be the one actually used.- Parameters:
 fileLoader- a {link FileLoader} intance
 
- 
getResourceObject
public Resource getResourceObject(java.lang.String filePath)
Obtains the cached object held by theResourceCachemapping table- Parameters:
 filePath- Location of the corresponding Resource- Returns:
 - the cached object, or null if the file doesn't exist or there is a problem while loading it.
 
 
- 
getCachedObject
public java.lang.Object getCachedObject(java.lang.String key)
Deprecated.This class should only be used to access Resources. UsegetResourceObject(String)Obtains the cached object held by theResourceCachemapping table- Parameters:
 key- Unique identifier for the cached object.- Returns:
 - the cached object, or null if the file doesn't exist or there is a problem while loading it.
 
 
- 
getResourceObject
public Resource getResourceObject(java.lang.String filePath, java.lang.String encode, java.lang.String localeID)
Obtains the cached object held by theResourceCachemapping table- Parameters:
 filePath- Location of the corresponding Resourceencode- the encoding used to open the file resource objectlocaleID- for the file. Notice this parameter is actually not used anymore.- Returns:
 - the cached object, or null if the file doesn't exist or there is a problem while loading it.
 
 
- 
getResourceObjectString
public java.lang.String getResourceObjectString(java.lang.String filePath)
Obtains the string contents of the cached object held by theResourceCachemapping table- Parameters:
 filePath- Location of the corresponding Resource- Returns:
 - the String contents of the cached object
 
 
- 
getResourceObjectString
public java.lang.String getResourceObjectString(java.lang.String filePath, java.lang.String encode, java.lang.String localeID)Obtains the string contents of the cached object held by theResourceCachemapping table- Parameters:
 filePath- Location of the corresponding Resourceencode- the encoding used to open the file resource objectlocaleID- for the file. Notice this parameter is actually not used anymore.- Returns:
 - the String contents of the cached object
 
 
- 
getResourceObjectDocument
public org.w3c.dom.Document getResourceObjectDocument(java.lang.String filePath)
Obtains the DOM Document contents of the cached object held by theResourceCachemapping table. Not thread safe to use theDocumentobject without synchronization. Strongly suggest synchronizing on the owningResourceobject. This method will likely be deprecated in the future. Please usegetResourceObject(String)instead.- Parameters:
 filePath- Location of the corresponding Resource- Returns:
 - the DOM Document contents of the cached object
 - See Also:
 getResourceObject(String)
 
- 
getResourceObjectDocument
public org.w3c.dom.Document getResourceObjectDocument(java.lang.String filePath, java.lang.String encode, java.lang.String localeID)Obtains the DOM Document contents of the cached object held by theResourceCachemapping table. Not thread safe to use theDocumentobject without synchronization. Strongly suggest synchronizing on the owningResourceobject. This method will likely be deprecated in the future. Please usegetResourceObject(String, String, String)instead.- Parameters:
 filePath- Location of the corresponding Resourceencode- the encoding used to open the file resource objectlocaleID- for the file. Notice this parameter is actually not used anymore.- Returns:
 - the DOM Document contents of the cached object
 - See Also:
 getResourceObject(String, String, String)
 
- 
storeResourceObject
public void storeResourceObject(java.lang.String key, java.lang.Object resourceObject)Deprecated.Should not be called explicitly. To cache objects, callers should implement their own CacheStores in the cache table the object provided. This method should not be called explicitly anymore. It is recommended that classes that want to cache their own elements, should create their own Cache by extending the CacheBase or any of its subclasses.- Parameters:
 key- The unique identifier of the object in the cache tableresourceObject- the object to store
 
- 
storeObjectToCache
public void storeObjectToCache(java.lang.String key, java.lang.Object resourceObject)Deprecated.Should not be called explicitly. To cache objects, callers should implement their own CacheStores in the cache table the object provided. This method should not be called explicitly anymore. It is recommended that classes that want to cache their own elements, should create their own Cache by extending the CacheBase or any of its subclasses.- Parameters:
 key- The unique identifier of the object in the cache tableresourceObject- the object to store
 
- 
storeResourceObject
public void storeResourceObject(java.lang.String key, java.lang.String encode, java.lang.String localeID, java.lang.Object resourceObject)Deprecated.Should not be called explicitly. To cache objects, callers should implement their own CacheStores in the cache table the object provided. This method should not be called explicitly anymore. It is recommended that classes that want to cache their own elements, should create their own Cache by extending the CacheBase or any of its subclasses.- Parameters:
 key- The unique identifier of the object in the cache tableencode- The unique identifier of the object in the cache tablelocaleID- The unique identifier of the object in the cache tableresourceObject- the object to store
 
- 
getFileLoader
public FileLoader getFileLoader()
Deprecated.FileLoader usage is now recommended as a singleton. You can access it by:FileLoader.getInstance();Gets the file loader that the cache mapping will use to load files from the file system.
- Returns:
 - FileLoader a 
FileLoaderinstace 
 
 - 
 
 -