public class

ResourceCacheManager

extends Object
java.lang.Object
   ↳ com.microstrategy.web.app.utils.cache.ResourceCacheManager

Class Overview

The ResourceCacheManager is basically a wrapper of the ResourceCache. It provides helper methods to access Resource objects without having to catch CacheException or to create CacheHints on the fly. Copyright © 2002 MicroStrategy, Inc.

See Also

Summary

Public Methods
Object getCachedObject(String key)
This method is deprecated. This class should only be used to access Resources. Use getResourceObject(String)
FileLoader getFileLoader()
This method is deprecated. FileLoader usage is now recommended as a singleton. You can access it by: FileLoader.getInstance();
static ResourceCacheManager getInstance()
Returns the instance of the ResourceCacheManager class
Resource getResourceObject(String filePath)
Obtains the cached object held by the ResourceCache mapping table
Resource getResourceObject(String filePath, String encode, String localeID)
Obtains the cached object held by the ResourceCache mapping table
Document getResourceObjectDocument(String filePath, String encode, String localeID)
Obtains the DOM Document contents of the cached object held by the ResourceCache mapping table.
Document getResourceObjectDocument(String filePath)
Obtains the DOM Document contents of the cached object held by the ResourceCache mapping table.
String getResourceObjectString(String filePath, String encode, String localeID)
Obtains the string contents of the cached object held by the ResourceCache mapping table
String getResourceObjectString(String filePath)
Obtains the string contents of the cached object held by the ResourceCache mapping table
void init(FileLoader fileLoader)
This method is deprecated. FileLoader usage is now recommended as a singleton. The FileLoader should now always be accessed by: FileLoader.getInstance();
void storeObjectToCache(String key, Object resourceObject)
This method is deprecated. Should not be called explicitly. To cache objects, callers should implement their own Cache
void storeResourceObject(String key, String encode, String localeID, Object resourceObject)
This method is deprecated. Should not be called explicitly. To cache objects, callers should implement their own Cache
void storeResourceObject(String key, Object resourceObject)
This method is deprecated. Should not be called explicitly. To cache objects, callers should implement their own Cache
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public Object getCachedObject (String key)

This method is deprecated.
This class should only be used to access Resources. Use getResourceObject(String)

Obtains the cached object held by the ResourceCache mapping 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.

public FileLoader getFileLoader ()

This method is 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

public static ResourceCacheManager getInstance ()

Returns the instance of the ResourceCacheManager class

Returns

public Resource getResourceObject (String filePath)

Obtains the cached object held by the ResourceCache mapping 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.

public Resource getResourceObject (String filePath, String encode, String localeID)

Obtains the cached object held by the ResourceCache mapping table

Parameters
filePath Location of the corresponding Resource
encode the encoding used to open the file resource object
localeID 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.

public Document getResourceObjectDocument (String filePath, String encode, String localeID)

Obtains the DOM Document contents of the cached object held by the ResourceCache mapping table. Not thread safe to use the Document object without synchronization. Strongly suggest synchronizing on the owning Resource object. This method will likely be deprecated in the future. Please use getResourceObject(String, String, String) instead.

Parameters
filePath Location of the corresponding Resource
encode the encoding used to open the file resource object
localeID for the file. Notice this parameter is actually not used anymore.
Returns
  • the DOM Document contents of the cached object

public Document getResourceObjectDocument (String filePath)

Obtains the DOM Document contents of the cached object held by the ResourceCache mapping table. Not thread safe to use the Document object without synchronization. Strongly suggest synchronizing on the owning Resource object. This method will likely be deprecated in the future. Please use getResourceObject(String) instead.

Parameters
filePath Location of the corresponding Resource
Returns
  • the DOM Document contents of the cached object

public String getResourceObjectString (String filePath, String encode, String localeID)

Obtains the string contents of the cached object held by the ResourceCache mapping table

Parameters
filePath Location of the corresponding Resource
encode the encoding used to open the file resource object
localeID for the file. Notice this parameter is actually not used anymore.
Returns
  • the String contents of the cached object

public String getResourceObjectString (String filePath)

Obtains the string contents of the cached object held by the ResourceCache mapping table

Parameters
filePath Location of the corresponding Resource
Returns
  • the String contents of the cached object

public void init (FileLoader fileLoader)

This method is deprecated.
FileLoader usage is now recommended as a singleton. The FileLoader should now always be accessed by: FileLoader.getInstance();

Initializes the ResourceCache object 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 the FileLoader provided might not be the one actually used.

Parameters
fileLoader a {link FileLoader} intance

public void storeObjectToCache (String key, Object resourceObject)

This method is deprecated.
Should not be called explicitly. To cache objects, callers should implement their own Cache

Stores 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 table
resourceObject the object to store

public void storeResourceObject (String key, String encode, String localeID, Object resourceObject)

This method is deprecated.
Should not be called explicitly. To cache objects, callers should implement their own Cache

Stores 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 table
encode The unique identifier of the object in the cache table
localeID The unique identifier of the object in the cache table
resourceObject the object to store

public void storeResourceObject (String key, Object resourceObject)

This method is deprecated.
Should not be called explicitly. To cache objects, callers should implement their own Cache

Stores 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 table
resourceObject the object to store