Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


oracle.wcps.cache
Interface CacheConfig


@MXBean
public interface CacheConfig

Field Summary
static int TTL_NEVER_EXPIRE
          Setting for time to live that indicates forever; elements in cache will never expire.

 

Method Summary
 void clear()
          Clear the cache.
 void clearStats()
          Reset Hit and Miss counts to zero.
 java.lang.String getCacheName()
          Get cache name.
 int getHitCount()
          The Hit count is incremented each time a get operation is called on a known key.
 int getMaxEntries()
          Get maximum number of entries allowed in the cache.
 int getMissCount()
          The Miss count is incremented each time a get operation is called on an unknown key.
 long getTimeToLive()
          Get current time-to-live for cache elements (in milliseconds).
 boolean isActive()
          Specifies whether this cache is active.
 void setActive(boolean isActive)
          Set the desired active mode of cache.
 void setMaxEntries(int maxEntries)
          Set the desired maximum number of entries allowed in the cache.
 void setTimeToLive(long ttl)
          Set the desired time-to-live (in milliseconds) for cache elements.

 

Field Detail

TTL_NEVER_EXPIRE

static final int TTL_NEVER_EXPIRE
Setting for time to live that indicates forever; elements in cache will never expire.
See Also:
Constant Field Values

Method Detail

getCacheName

java.lang.String getCacheName()
Get cache name. Each cache has a unique name, and is referenced by that name. The CacheFactory maintains a collection of cache objects, and the cache name represents the key in the key/value pair in the collection.
Returns:
The cache name

isActive

boolean isActive()
Specifies whether this cache is active. An inactive cache will ignore all puts, and all get operations will act as if the cache is always empty.
Returns:
true if the cache is active

setActive

void setActive(boolean isActive)
Set the desired active mode of cache. It is not guarantee that this method will actually affect the cache, it should be considered a 'hint', as the cache may be configured externally.
Parameters:
isActive - A hint as to the desired active setting of the cache

getMaxEntries

int getMaxEntries()
Get maximum number of entries allowed in the cache. When the number of elements in the cache exceeds this size, least recently accessed elements will be removed. Note that this value may be inexact as the cache may be externally managed and not have access to this information.
Returns:
The maximum size of the cache.

setMaxEntries

void setMaxEntries(int maxEntries)
Set the desired maximum number of entries allowed in the cache. It is not guarantee that this method will actually affect the cache, it should be considered a 'hint', as the cache may be configured externally.
Parameters:
maxEntries - hint as to the desired maximum size of the cache. Must be set to a positive (non-zero) number.
Throws:
java.lang.IllegalArgumentException - if maxEntries is not a positive number.

getTimeToLive

long getTimeToLive()
Get current time-to-live for cache elements (in milliseconds). Elements which expire (outlive their time-to-live) will be removed from the cache. Element lifetime is measured from when it was added to the cache. Note that this value may be inexact as the cache may be externally managed and not have access to this information.
Returns:
The time to live for elements in the cache, in milliseconds.

setTimeToLive

void setTimeToLive(long ttl)
Set the desired time-to-live (in milliseconds) for cache elements. It is not guarantee that this method will actually affect the cache, it should be considered a 'hint', as the cache may be configured externally.
Parameters:
ttl - The time to live for the cache, in milliseconds. Must be set to a positive (non-zero) number or TTL_NEVER_EXPIRE.
Throws:
java.lang.IllegalArgumentException - if ttl is not a positive number or TTL_NEVER_EXPIRE.

clear

void clear()
Clear the cache. This method allows access to clear the cache via an MBean.

getHitCount

int getHitCount()
The Hit count is incremented each time a get operation is called on a known key.

getMissCount

int getMissCount()
The Miss count is incremented each time a get operation is called on an unknown key.

clearStats

void clearStats()
Reset Hit and Miss counts to zero.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


Copyright © 2009, 2013, Oracle and/or its affiliates. All rights reserved.