© 2001 BEA Systems, Inc.

com.beasys.commerce.foundation.cache
Class CacheFactory

java.lang.Object
  |
  +--com.beasys.commerce.foundation.cache.CacheFactory

public class CacheFactory
extends java.lang.Object

Factory to create Singleton Cache objects.


Field Summary
static java.lang.String CAPACITY_SUFFIX
          property suffix to describe the cache capacity setting
static java.lang.String ENABLED_SUFFIX
          property suffix to describe the cache enabled setting
static java.lang.String TTL_SUFFIX
          property suffix to describe the cache time-to-live setting
 
Constructor Summary
CacheFactory()
           
 
Method Summary
static java.util.Enumeration getAllCacheNames()
          Returns a list of all Cache objects.
static Cache getCache(java.lang.String name)
          Returns a Cache by name.
static Cache getCache(java.lang.String name, int initialSize, long itemTtl, boolean enabled)
          Creates a Cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TTL_SUFFIX

public static java.lang.String TTL_SUFFIX
property suffix to describe the cache time-to-live setting

CAPACITY_SUFFIX

public static java.lang.String CAPACITY_SUFFIX
property suffix to describe the cache capacity setting

ENABLED_SUFFIX

public static java.lang.String ENABLED_SUFFIX
property suffix to describe the cache enabled setting
Constructor Detail

CacheFactory

public CacheFactory()
Method Detail

getAllCacheNames

public static java.util.Enumeration getAllCacheNames()
Returns a list of all Cache objects.

getCache

public static Cache getCache(java.lang.String name,
                             int initialSize,
                             long itemTtl,
                             boolean enabled)
Creates a Cache. If the cache exists, returns the existing Cache but does not modify its operation parameters. If any of the cache properties are invalid, the defaults will be used.
Parameters:
name - the name of the cache to retrieve
initialSize - the initial size of the cache
itemTtl - the default time-to-live for this cache
enabled - whether or not this cache is enabled
Returns:
the cache that was created or retrieved.

getCache

public static Cache getCache(java.lang.String name)
Returns a Cache by name. Properties for the cache will be retrieved from the server properties file. If the cache does not already exist, it will be created; otherwise the pre-existing cache will be returned.
Parameters:
the - name of the cache

© 2001 BEA Systems, Inc.

Copyright © 2001 BEA Systems, Inc. All Rights Reserved