Class DistributedObjectCacheFactory

java.lang.Object
com.ibm.wsspi.cache.DistributedObjectCacheFactory

public class DistributedObjectCacheFactory extends Object
This class provides components with factory methods to create/lookup instances of a DistributedObjectCache. Each DistributedObjectCache instance can be configured independently. Use the DistributedObjectCache.getMapType method to determine the map type. The following property keys should be used to specify the configuration of the DistributedMap or DistributedNioMap created using this class.
See Also:
  • Field Details

    • KEY_CACHE_SIZE

      public static final String KEY_CACHE_SIZE
      Property key to specify cache size. Value is string int
      Since:
      v6.0
      See Also:
    • KEY_DISABLE_DEPENDENCY_ID

      public static final String KEY_DISABLE_DEPENDENCY_ID
      Property key to disble dependency support. Value is VALUE_TRUE or VALUE_FALSE
      Since:
      v6.0
      See Also:
    • KEY_DISABLE_TEMPLATES_SUPPORT

      public static final String KEY_DISABLE_TEMPLATES_SUPPORT
      Property key to disble template support. Value is VALUE_TRUE or VALUE_FALSE
      Since:
      v6.0
      See Also:
    • KEY_ENABLE_DISK_OFFLOAD

      public static final String KEY_ENABLE_DISK_OFFLOAD
      Property key to enable disk offload support. Value is VALUE_TRUE or VALUE_FALSE
      Since:
      v6.0
      See Also:
    • KEY_ENABLE_NIO_SUPPORT

      public static final String KEY_ENABLE_NIO_SUPPORT
      Property key to enable nio support. Value is VALUE_TRUE or VALUE_FALSE
      Since:
      v6.0
      See Also:
    • KEY_DISK_OFFLOAD_LOCATION

      public static final String KEY_DISK_OFFLOAD_LOCATION
      Property key to specify the disk offload location. Value is string path
      Since:
      v6.0
      See Also:
    • KEY_USE_LISTENER_CONTEXT

      public static final String KEY_USE_LISTENER_CONTEXT
      Property key to enable listener context on callbacks. Value is VALUE_TRUE or VALUE_FALSE
      Since:
      v6.0
      See Also:
    • KEY_FLUSH_TO_DISK_ON_STOP

      public static final String KEY_FLUSH_TO_DISK_ON_STOP
      Property key to enable flushing cache contents to disk when the server is stopped. This property is ignored if disk offload is disabled. Value is VALUE_TRUE or VALUE_FALSE
      Since:
      v6.0
      See Also:
    • KEY_ENABLE_CACHE_REPLICATION

      public static final String KEY_ENABLE_CACHE_REPLICATION
      Property key to enable cache replication. Value is VALUE_TRUE or VALUE_FALSE
      Since:
      v6.0
      See Also:
    • KEY_REPLICATION_DOMAIN

      public static final String KEY_REPLICATION_DOMAIN
      Property key to specify the replication domain. Value is string domain name.
      Since:
      v6.0
      See Also:
    • KEY_DISKCACHE_PERFORMANCE_LEVEL

      public static final String KEY_DISKCACHE_PERFORMANCE_LEVEL
      Property key to specify the disk cache performance level. Value: 0 - Low Performance and low memory usage; Value: 1 - Balanced Performance and balanced memory usage (default); Value: 2 - Custom Performance and custom memory usage; Value: 3 - High Performance and high memory usage;
      Since:
      v6.1
      See Also:
    • KEY_DISK_CLEANUP_FREQUENCY

      public static final String KEY_DISK_CLEANUP_FREQUENCY
      Property key to specify the frequency at which the disk cache cleanup daemon should remove expired entries from the disk cache. Value: positive value in minutes; default = 0 (cleanup is scheduled to run at midnight).
      Since:
      v6.0
      See Also:
    • KEY_DISK_DELAY_OFFLOAD_ENTRIES_LIMIT

      public static final String KEY_DISK_DELAY_OFFLOAD_ENTRIES_LIMIT
      Property key to provide a way to limit the buffering of dependency and template information by specify an upper bound on the number of cache entries any specific dependency can contain for buffering in memory. If there are more entries per dependency than this limit, the dependency/template information is written to disk. Value: positive value; default = 1000;
      Since:
      v6.0
      See Also:
    • KEY_DISK_DELAY_OFFLOAD_DEPID_BUCKETS

      public static final String KEY_DISK_DELAY_OFFLOAD_DEPID_BUCKETS
      Property key to provide a way to limit the buffering of dependency ID information by specifying an upper bound on the number of dependencies that will be buffered in memory. If the count of dependencies exceeds this limit, the excess will be written to disk. Value: positive value; default = 1000;
      Since:
      v6.0
      See Also:
    • KEY_DISK_DELAY_OFFLOAD_TEMPLATE_BUCKETS

      public static final String KEY_DISK_DELAY_OFFLOAD_TEMPLATE_BUCKETS
      Property key to provide a way to limit the buffering of template information by specifying an upper bound on the number of templates that will be buffered in memory. If the count of templates exceeds this limit, the excess will be written to disk. Value: positive value; default = 1000;
      Since:
      v6.0
      See Also:
    • KEY_DISKCACHE_EVICTION_POLICY

      public static final String KEY_DISKCACHE_EVICTION_POLICY
      Property key to specify the disk cache eviction policy. Value: 0 (none) - eviction algorithm disabled (default); Value: 1 (random) - The expired objects are removed first. If the disk size has not reached the low threshold limit, objects are picked from disk cache in random order until the disk cache size has reached. Value: 2 (size based) - The expired objects are removed first. If the disk size has not reached the low threshold limit, largest-sized objects are removed until the disk cache size has reached
      Since:
      v6.1
      See Also:
    • KEY_DISKCACHE_HIGH_THRESHOLD

      public static final String KEY_DISKCACHE_HIGH_THRESHOLD
      Property key to specify the high threshold in percentage. It is used to start evicting objects out of disk cache when one or both of the high thresholds is reached Value: 0 - 100
      Since:
      v6.1
      See Also:
    • KEY_DISKCACHE_LOW_THRESHOLD

      public static final String KEY_DISKCACHE_LOW_THRESHOLD
      Property key to specify the low threshold in percentage. It is used to bring down the disk cache till the low threshold is reached. Value: 0 - 100
      Since:
      v6.1
      See Also:
    • KEY_DISKCACHE_SIZE

      public static final String KEY_DISKCACHE_SIZE
      Property key to specify the limit of disk cache size in entries. Value: positive integer; default 0 means no limit
      Since:
      v6.1
      See Also:
    • KEY_DISKCACHE_SIZE_GB

      public static final String KEY_DISKCACHE_SIZE_GB
      Property key to specify the limit of disk cache size in GB. Value: positive integer; default 0 means no limit
      Since:
      v6.1
      See Also:
    • KEY_DISKCACHE_ENTRY_SIZE_MB

      public static final String KEY_DISKCACHE_ENTRY_SIZE_MB
      Property key to specify the limit of disk cache entry size in MB. Value: positive integer; default 0 means no limit
      Since:
      v6.1
      See Also:
    • KEY_LRU_TO_DISK_TRIGGER_PERCENT

      public static final String KEY_LRU_TO_DISK_TRIGGER_PERCENT
      Property key to specify the limit of percentage of the memory cache size used as a overflow buffer when disk offload is enabled. Value: 0 - 100; default 0 means no overflow
      Since:
      v6.1
      See Also:
    • KEY_MEMORY_CACHE_SIZE_IN_MB

      public static final String KEY_MEMORY_CACHE_SIZE_IN_MB
      Property key to specify a value for the maximum memory cache size in megabytes (MB). Value: positive integer; default: -1 means no limit on memory cache size
      Since:
      v7.0
      See Also:
    • KEY_MEMORY_CACHE_SIZE_HIGH_THRESHOLD

      public static final String KEY_MEMORY_CACHE_SIZE_HIGH_THRESHOLD
      Property key to specify the memory cache size high threshold in percentage. It is used to start evicting objects out of memory cache until the high threshold is reached Value: 0 - 100 (default: 95)
      Since:
      v7.0
      See Also:
    • KEY_MEMORY_CACHE_SIZE_LOW_THRESHOLD

      public static final String KEY_MEMORY_CACHE_SIZE_LOW_THRESHOLD
      Property key to specify the memory cache low threshold in percentage. It is used to prune the memory cache until the low threshold is reached. Value: 0 - 100 (default: 80)
      Since:
      v7.0
      See Also:
    • VALUE_TRUE

      public static final String VALUE_TRUE
      Property value for true.
      Since:
      v6.0
      See Also:
    • VALUE_FALSE

      public static final String VALUE_FALSE
      Property value for false.
      Since:
      v6.0
      See Also:
    • distributedMaps

      public static Map<String,DistributedObjectCache> distributedMaps
  • Method Details

    • getMap

      public static DistributedObjectCache getMap(String name)
      Returns the DistributedMap instance specified by the given id. If the given instance has not yet been created, then a new instance is created using the default parameters.
      Parameters:
      name - instance name
      Returns:
      A DistributedMap instance
      See Also:
    • removeMap

      public static DistributedObjectCache removeMap(String name)
    • getMap

      public static DistributedObjectCache getMap(String name, Properties properties)
      Returns the DistributedMap or DistributedNioMap instance specified by the given id, using the the parameters specified in properties. If the given instance has not yet been created, then a new instance is created using the parameters specified in the properties object. Use the various KEY_xxx and VALUE_xxx constants to populate the passed properties object.
      Parameters:
      name - instance name
      properties -
      Returns:
      A DistributedObjectCache instance
    • createDistributedObjectCache

      public static DistributedObjectCache createDistributedObjectCache(String name, Properties properties)
    • setCacheService

      public static void setCacheService(com.ibm.ws.cache.CacheService cacheService)
    • unsetCacheService

      public static void unsetCacheService(com.ibm.ws.cache.CacheServiceImpl cacheServiceImpl)