Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2008 BEA Systems, Inc. All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.cache
Interface CacheConfig

    public interface CacheConfig

Configuration of a Cache. Usually implemented by a descriptor bean mapping to `META-INF/p13n-cache-config.xml`.

This interface is intended to be implemented only by BEA Weblogic Portal. BEA Systems reserves the right to add abstract methods to this interface without notice. Implementations of this interface by other parties must not be expected to compile without change in future versions of BEA Weblogic Portal.

Field Summary
`static boolean` | `DEFAULT_ENABLED` Default for enabled setting of a cache.
`static int` | `DEFAULT_MAX_ENTRIES` Default for the size of a cache (max number of entries).
`static long` | `DEFAULT_TTL` Default time to live for elements in the cache, in millisecs Value is one hour.
`static int` | `MAX_ENTRIES_MAX` Maximum value for the size of the cache (maximum number of entries).
`static int` | `TTL_NEVER_EXPIRE` Setting for time to live that indicates forever; elements in cache will never expire.

Method Summary
`boolean` | `getEnabled()` Get enabled mode of cache.
`int` | `getMaxEntries()` Get maximum number of entries allowed in the cache.
`String` | `getProviderId()` Get the id of the provider to use for this cache.
`long` | `getTimeToLive()` Get default time to live for cache elements (in milliseconds).
`void` | `setEnabled(boolean isEnabled)` Set enabled mode of cache.
`void` | `setMaxEntries(int size)` Set the maximum number of entries allowed in the cache.
`void` | `setProviderId(String providerId)` Set the provider id to use for this named cache.
`void` | `setTimeToLive(long ttl)` Set the default time-to-live (in milliseconds) for elements added to the cache.

Field Detail

### DEFAULT_TTL

    static final long DEFAULT_TTL

  Default time to live for elements in the cache, in millisecs Value is one hour.

  See Also
    Constants Summary

### TTL_NEVER_EXPIRE

    static final int TTL_NEVER_EXPIRE

  Setting for time to live that indicates forever; elements in cache will never expire. Value is -1.

  See Also
    Constants Summary

### MAX_ENTRIES_MAX

    static final int MAX_ENTRIES_MAX

  Maximum value for the size of the cache (maximum number of entries). Value is Integer.MAX_VALUE.

  See Also
    Constants Summary

### DEFAULT_MAX_ENTRIES

    static final int DEFAULT_MAX_ENTRIES

  Default for the size of a cache (max number of entries). Value is 100.

  See Also
    Constants Summary

### DEFAULT_ENABLED

    static final boolean DEFAULT_ENABLED

  Default for enabled setting of a cache. Value is true (enabled).

  See Also
    Constants Summary

Method Detail

### setEnabled

    void setEnabled(boolean isEnabled)

  Set enabled mode of cache. A disabled cache's methods - get, add, remove, etc - will do nothing. This can be used to turn off caching for debugging, development, etc.

  Parameters
    `isEnabled` - The enabled setting of the cache

### getEnabled

    boolean getEnabled()

  Get enabled mode of cache.

  Returns
    The current enabled mode of the cache.
  See Also
    `setEnabled(boolean)`

### setTimeToLive

    void setTimeToLive(long ttl)

  Set the default time-to-live (in milliseconds) for elements added to the cache. Elements which outlive their time-to-live will be removed from the cache. Must be set to a positive (non-zero) number or to `TTL_NEVER_EXPIRE`.

  Parameters
    `ttl` - The time to live for the cache, in milliseconds.

### getTimeToLive

    long getTimeToLive()

  Get default time to live for cache elements (in milliseconds).

  Returns
    The time to live for the cache, in milliseconds.
  See Also
    `setTimeToLive(long)`

### setMaxEntries

    void setMaxEntries(int size)

  Set the maximum number of entries allowed in the cache. If the number of elements in the cache exceeds this size, older elements will be removed (using an LRU strategy).

  Parameters
    `size` - The maxium size of the cache.

### getMaxEntries

    int getMaxEntries()

  Get maximum number of entries allowed in the cache.

  Returns
    The maxium size of the cache.
  See Also
    `setMaxEntries(int)`

### setProviderId

    void setProviderId(String providerId)

  Set the provider id to use for this named cache.

  Parameters
    `providerId` - The id of the provider to use for this cache.
  See Also
    `CacheFactory`, `CacheProvider`

### getProviderId

    String getProviderId()

  Get the id of the provider to use for this cache. If null, or a provider with this id is not available, the default provider will be used instead.

  Returns
    The id of the provider to use for this cache.
  See Also
    `CacheFactory`, `CacheProvider`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 BEA Systems, Inc. All Rights Reserved