© 2002 BEA Systems, Inc.


com.bea.p13n.mbeans
Interface CacheMBean


public interface CacheMBean
extends ServiceConfigurationMBean, com.bea.p13n.cache.internal.system.CacheConfig

The MBean that configures individual instances of a cache. The name of this MBean corresponds to the name of the cache (as retrieved from CacheFactoy.getCache(name)). If this MBean does not exist for a cache, the CacheFactory will pick appropriate values (usually the defaults) for a new cache.

See Also:
Cache, CacheFactory

Fields inherited from class com.bea.p13n.cache.internal.system.CacheConfig
DEFAULT_ENABLED, DEFAULT_MAX_ENTRIES, DEFAULT_TTL, MAX_ENTRIES_MAX, TTL_NEVER_EXPIRE
 
Fields inherited from class weblogic.management.configuration.ConfigurationMBean
CACHING_STUB_SVUID
 
Method Summary
 boolean getEnabled()
          Get enabled mode of cache.
 int getMaxEntries()
          Get maximum number of entries allowed in the 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 setTimeToLive(long ttl)
          Set the default time-to-live (in millisec) for elements added to the cache.
 
Methods inherited from interface weblogic.management.configuration.ConfigurationMBean
addLinkMbeanAttribute, getAttributeStringValue, getNotes, getSetFields, getXml, getXmlConverter, isPersistenceEnabled, setNotes, setPersistenceEnabled
 
Methods inherited from interface weblogic.management.WebLogicMBean
getMBeanInfo, getName, getObjectName, getParent, getType, isCachingDisabled, isRegistered, setName, setParent
 
Methods inherited from interface javax.management.DynamicMBean
getAttribute, getAttributes, invoke, setAttribute, setAttributes
 
Methods inherited from interface javax.management.MBeanRegistration
postDeregister, postRegister, preDeregister, preRegister
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListener
 

Method Detail

setEnabled

public void setEnabled(boolean isEnabled)
Set enabled mode of cache. Disabling the cache will cause fetch, add, and remove to do nothing.

The cache may be cleared of its contents by checking the "flush" tab on the cache administration console.

Specified by:
setEnabled in interface com.bea.p13n.cache.internal.system.CacheConfig

A dynamic MBean attribute
Parameters:
isEnabled - Enabled state of the cache

getEnabled

public boolean getEnabled()
Get enabled mode of cache.
Specified by:
getEnabled in interface com.bea.p13n.cache.internal.system.CacheConfig

Default Value: DEFAULT_ENABLED
Old Property: cacheName.enabled

setTimeToLive

public void setTimeToLive(long ttl)
Set the default time-to-live (in millisec) for elements added to the cache. Must be set to a positive number or to TTL_NEVER_EXPIRE.
Specified by:
setTimeToLive in interface com.bea.p13n.cache.internal.system.CacheConfig

A dynamic MBean attribute
Legal Value: (value > 0) || (value == self.TTL_NEVER_EXPIRE)
Parameters:
ttl - Default time to live for cache elements, in milliseconds

getTimeToLive

public long getTimeToLive()
Get default time to live for cache elements (in milliseconds).
Specified by:
getTimeToLive in interface com.bea.p13n.cache.internal.system.CacheConfig

Default Value: DEFAULT_TTL
Old Property: cacheName.ttl

setMaxEntries

public 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).
Specified by:
setMaxEntries in interface com.bea.p13n.cache.internal.system.CacheConfig

A dynamic MBean attribute
Legal Minimum Value: 1
Legal Maximum Value: MAX_ENTRIES_MAX
Parameters:
size - Maximum number of elements allowed in the cache

getMaxEntries

public int getMaxEntries()
Get maximum number of entries allowed in the cache.
Specified by:
getMaxEntries in interface com.bea.p13n.cache.internal.system.CacheConfig

Default Value: DEFAULT_MAX_ENTRIES
Old Property: cacheName.capacity

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved