SAP NetWeaver '04

com.sapportals.wcm.util.cache
Class CacheFactory

[contained in: com.sap.netweaver.bc.util.par - bc.util.public_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.util.cache.CacheFactory

public class CacheFactory
extends java.lang.Object

Create caches (singleton)


Field Summary
static java.lang.String CFG_AUTO_DELAY_EXPIRATION_KEY
           
static java.lang.String CFG_AVERAGE_ENTRY_SIZE_KEY
           
static java.lang.String CFG_CACHE_CLASS_KEY
           
static java.lang.String CFG_CACHE_TYPE_KEY
           
static java.lang.String CFG_CAPACITY_KEY
           
static java.lang.String CFG_CLEAR_CACHE_ON_INIT_KEY
           
static java.lang.String CFG_DEFAULT_TIME_TO_LIVE_KEY
           
static java.lang.String CFG_FILE_PREFIX_KEY
           
static java.lang.String CFG_FOLDER_KEY
           
static java.lang.String CFG_LONGKEYMEMORY_KEY
           
static java.lang.String CFG_MAX_CACHE_SIZE_KEY
           
static java.lang.String CFG_MAX_ENTRY_SIZE_KEY
           
static java.lang.String CFG_MEMORY_KEY
           
static java.lang.String CFG_PERSISTENT_KEY
           
static java.lang.String CFG_SECURE_KEY
           
static java.lang.String CFG_SINGLETON_KEY
           
static java.lang.String CFG_STORAGE_CLASS_KEY
           
static java.lang.String CFG_STRINGKEYMEMORY_KEY
           
 
Method Summary
 void finalize()
          Release all cache factory resources.
 java.util.Hashtable getAllCaches()
           
 ICache getCache(java.lang.String cacheID)
           
 ICache getCache(java.lang.String cacheID, boolean useDefault)
           
 ICache getCache(java.lang.String cacheID, java.util.Properties properties)
           
 ICache getCache(java.lang.String configID, java.lang.String cacheID)
           
 ICache getCache(java.lang.String configID, java.lang.String cacheID, boolean useDefault)
           
static CacheFactory getInstance()
           
static java.lang.String getUniqueCacheID()
           
protected static void refreshCaches()
          Tell the CacheFactory that the caches have to be refreshed
static void resetFactory()
          Only for testing purposes.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CFG_CACHE_CLASS_KEY

public static final java.lang.String CFG_CACHE_CLASS_KEY

CFG_CACHE_TYPE_KEY

public static final java.lang.String CFG_CACHE_TYPE_KEY

CFG_CAPACITY_KEY

public static final java.lang.String CFG_CAPACITY_KEY

CFG_MAX_CACHE_SIZE_KEY

public static final java.lang.String CFG_MAX_CACHE_SIZE_KEY

CFG_AVERAGE_ENTRY_SIZE_KEY

public static final java.lang.String CFG_AVERAGE_ENTRY_SIZE_KEY

CFG_MAX_ENTRY_SIZE_KEY

public static final java.lang.String CFG_MAX_ENTRY_SIZE_KEY

CFG_STORAGE_CLASS_KEY

public static final java.lang.String CFG_STORAGE_CLASS_KEY

CFG_FOLDER_KEY

public static final java.lang.String CFG_FOLDER_KEY

CFG_FILE_PREFIX_KEY

public static final java.lang.String CFG_FILE_PREFIX_KEY

CFG_SECURE_KEY

public static final java.lang.String CFG_SECURE_KEY

CFG_CLEAR_CACHE_ON_INIT_KEY

public static final java.lang.String CFG_CLEAR_CACHE_ON_INIT_KEY

CFG_PERSISTENT_KEY

public static final java.lang.String CFG_PERSISTENT_KEY

CFG_MEMORY_KEY

public static final java.lang.String CFG_MEMORY_KEY

CFG_LONGKEYMEMORY_KEY

public static final java.lang.String CFG_LONGKEYMEMORY_KEY

CFG_STRINGKEYMEMORY_KEY

public static final java.lang.String CFG_STRINGKEYMEMORY_KEY

CFG_DEFAULT_TIME_TO_LIVE_KEY

public static final java.lang.String CFG_DEFAULT_TIME_TO_LIVE_KEY

CFG_AUTO_DELAY_EXPIRATION_KEY

public static final java.lang.String CFG_AUTO_DELAY_EXPIRATION_KEY

CFG_SINGLETON_KEY

public static final java.lang.String CFG_SINGLETON_KEY
Method Detail

getInstance

public static CacheFactory getInstance()
                                throws CacheException
Returns:
an instance of the cache factory. When called the first time, the configurations of all preconfigured caches are checked for completeness and consistency.
Throws:
CacheException - Exception raised in failure situation

getUniqueCacheID

public static java.lang.String getUniqueCacheID()
Returns:
a new, unique cache ID that can be used in a call of getCache(cacheID,properties).

getCache

public ICache getCache(java.lang.String cacheID)
                throws CacheException
Parameters:
cacheID - TBD: Description of the incoming method parameter
Returns:
a preconfigured cache.
Throws:
CacheException - Exception raised in failure situation

getCache

public ICache getCache(java.lang.String configID,
                       java.lang.String cacheID)
                throws CacheException
Parameters:
configID - TBD: Description of the incoming method parameter
cacheID - TBD: Description of the incoming method parameter
Returns:
a preconfigured cache.
Throws:
CacheException - Exception raised in failure situation

getCache

public ICache getCache(java.lang.String cacheID,
                       boolean useDefault)
                throws CacheException
Parameters:
cacheID - TBD: Description of the incoming method parameter
Returns:
a preconfigured cache.
Throws:
CacheException - Exception raised in failure situation

getCache

public ICache getCache(java.lang.String configID,
                       java.lang.String cacheID,
                       boolean useDefault)
                throws CacheException
Parameters:
configID - TBD: Description of the incoming method parameter
cacheID - TBD: Description of the incoming method parameter
Returns:
a preconfigured cache.
Throws:
CacheException - Exception raised in failure situation

getCache

public ICache getCache(java.lang.String cacheID,
                       java.util.Properties properties)
                throws CacheException
Parameters:
cacheID - TBD: Description of the incoming method parameter
properties - TBD: Description of the incoming method parameter
Returns:
a cache with specific properties. If no cache with the given ID exists, it is created - otherwise the existing cache is returned and the properties parameter is ignored. Use the getUniqueCacheID() method to get a new, unique cache ID for creating a new cache.
Throws:
CacheException - Exception raised in failure situation

getAllCaches

public java.util.Hashtable getAllCaches()
Returns:
a Hashtable that contains all caches. Key is cacheID, elements implement ICache.

finalize

public void finalize()
Release all cache factory resources.
Overrides:
finalize in class java.lang.Object

resetFactory

public static void resetFactory()
Only for testing purposes.

refreshCaches

protected static void refreshCaches()
Tell the CacheFactory that the caches have to be refreshed

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.