com.sapportals.wcm.util.cache

Class CacheFactory

java.lang.Object
  extended bycom.sapportals.wcm.util.cache.CacheFactory

public class CacheFactory
extends Object

Create caches (singleton)


Field Summary
static String CFG_AUTO_DELAY_EXPIRATION_KEY
           
static String CFG_AVERAGE_ENTRY_SIZE_KEY
           
static String CFG_CACHE_CLASS_KEY
           
static String CFG_CACHE_TYPE_KEY
           
static String CFG_CAPACITY_KEY
           
static String CFG_CLEAR_CACHE_ON_INIT_KEY
           
static String CFG_DEFAULT_TIME_TO_LIVE_KEY
           
static String CFG_FILE_PREFIX_KEY
           
static String CFG_FOLDER_KEY
           
static String CFG_LONGKEYMEMORY_KEY
           
static String CFG_MAX_CACHE_SIZE_KEY
           
static String CFG_MAX_ENTRY_SIZE_KEY
           
static String CFG_MEMORY_KEY
           
static String CFG_PERSISTENT_KEY
           
static String CFG_SECURE_KEY
           
static String CFG_SINGLETON_KEY
           
static String CFG_STORAGE_CLASS_KEY
           
static String CFG_STRINGKEYMEMORY_KEY
           
 
Method Summary
 void finalize()
          Release all cache factory resources.
 Hashtable getAllCaches()
           
 ICache getCache(String cacheID)
           
 ICache getCache(String cacheID, boolean useDefault)
           
 ICache getCache(String cacheID, Properties properties)
           
 ICache getCache(String configID, String cacheID)
           
 ICache getCache(String configID, String cacheID, boolean useDefault)
           
 ICache getCacheRaw(String cacheId)
          Gets the cache with the given id out of all caches.
static CacheFactory getInstance()
           
static 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 String CFG_CACHE_CLASS_KEY
See Also:
Constant Field Values

CFG_CACHE_TYPE_KEY

public static final String CFG_CACHE_TYPE_KEY
See Also:
Constant Field Values

CFG_CAPACITY_KEY

public static final String CFG_CAPACITY_KEY
See Also:
Constant Field Values

CFG_MAX_CACHE_SIZE_KEY

public static final String CFG_MAX_CACHE_SIZE_KEY
See Also:
Constant Field Values

CFG_AVERAGE_ENTRY_SIZE_KEY

public static final String CFG_AVERAGE_ENTRY_SIZE_KEY
See Also:
Constant Field Values

CFG_MAX_ENTRY_SIZE_KEY

public static final String CFG_MAX_ENTRY_SIZE_KEY
See Also:
Constant Field Values

CFG_STORAGE_CLASS_KEY

public static final String CFG_STORAGE_CLASS_KEY
See Also:
Constant Field Values

CFG_FOLDER_KEY

public static final String CFG_FOLDER_KEY
See Also:
Constant Field Values

CFG_FILE_PREFIX_KEY

public static final String CFG_FILE_PREFIX_KEY
See Also:
Constant Field Values

CFG_SECURE_KEY

public static final String CFG_SECURE_KEY
See Also:
Constant Field Values

CFG_CLEAR_CACHE_ON_INIT_KEY

public static final String CFG_CLEAR_CACHE_ON_INIT_KEY
See Also:
Constant Field Values

CFG_PERSISTENT_KEY

public static final String CFG_PERSISTENT_KEY
See Also:
Constant Field Values

CFG_MEMORY_KEY

public static final String CFG_MEMORY_KEY
See Also:
Constant Field Values

CFG_LONGKEYMEMORY_KEY

public static final String CFG_LONGKEYMEMORY_KEY
See Also:
Constant Field Values

CFG_STRINGKEYMEMORY_KEY

public static final String CFG_STRINGKEYMEMORY_KEY
See Also:
Constant Field Values

CFG_DEFAULT_TIME_TO_LIVE_KEY

public static final String CFG_DEFAULT_TIME_TO_LIVE_KEY
See Also:
Constant Field Values

CFG_AUTO_DELAY_EXPIRATION_KEY

public static final String CFG_AUTO_DELAY_EXPIRATION_KEY
See Also:
Constant Field Values

CFG_SINGLETON_KEY

public static final String CFG_SINGLETON_KEY
See Also:
Constant Field Values
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 String getUniqueCacheID()
Returns:
a new, unique cache ID that can be used in a call of getCache(cacheID,properties).

getCache

public ICache getCache(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(String configID,
                       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(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(String configID,
                       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(String cacheID,
                       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 Hashtable getAllCaches()
Returns:
a Hashtable that contains all caches. Key is cacheID, elements implement ICache.

getCacheRaw

public ICache getCacheRaw(String cacheId)
Gets the cache with the given id out of all caches. This method is for use in the jmx instrumentation of the cache service only.

Returns:
Cache with given id.

finalize

public void finalize()
Release all cache factory resources.


resetFactory

public static void resetFactory()
Only for testing purposes.


refreshCaches

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



Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. 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.