Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.javatools.util
Class Maps.ManagedCacheMap<K,V>

java.lang.Object
  extended by oracle.javatools.util.Maps.AbstractHashMap<K,V,E>
      extended by oracle.javatools.util.Maps.AbstractLinkedHashMap<K,V,E>
          extended by oracle.javatools.util.Maps.AbstractCacheMap<K,V,Maps.AbstractLinkedEntry<K,V>>
              extended by oracle.javatools.util.Maps.CacheMap<K,V>
                  extended by oracle.javatools.util.Maps.ManagedCacheMap<K,V>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<K,V>, Maps.ManagedCacheMapMBean
Enclosing class:
Maps

public static class Maps.ManagedCacheMap<K,V>
extends Maps.CacheMap<K,V>
implements Maps.ManagedCacheMapMBean

A cache map which is an MBean and can be monitored by a JMX client (e.g., JConsole).

This map will be registered with the MBean server using the following object name, where name is the name given in the constructor:

  ":type=CacheMap,name=" + name  
Typically, the given name should uniquely identify the instance object which contains and uses the map. If that instance object is a singleton, its class name is typically sufficient; if not, then an additional distinguishing property should be appended. For example, if the containing instances are uniquely characterized by a URL property, then the string passed to the constructor could be:
  getClass().getSimpleName() + ",url=" + getUrl() 
Notice how the URL is appended as an additional property, separated by a comma (",url="). This is not strictly required, but better fits standard JMX object naming conventions. Also note that if the value contains certain characters (for example, a file path if a URL contained a "?" or a file name contained a "\", see ObjectName), it must be quoted using ObjectName.quote(java.lang.String).

See Also:
ObjectName, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.util.Maps.AbstractCacheMap
Maps.AbstractCacheMap.MappingType, Maps.AbstractCacheMap.ReferenceType
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class oracle.javatools.util.Maps.AbstractCacheMap
CANONICAL, HARD, NONCANONICAL, SOFT, WEAK
 
Fields inherited from class oracle.javatools.util.Maps.AbstractHashMap
DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, MAXIMUM_CAPACITY
 
Constructor Summary
Maps.ManagedCacheMap(int bound, Maps.AbstractCacheMap.MappingType mappingType, java.lang.String name)
          Constructs a bounded LRU (least recently used), hard-referenced, canonically-mapped, cache map.
Maps.ManagedCacheMap(int bound, Maps.AbstractCacheMap.ReferenceType valueReferenceType, java.lang.String name)
          Constructs a bounded LRU (least recently used), hard-referenced cache map.
Maps.ManagedCacheMap(int bound, java.lang.String name)
          Constructs a bounded LRU (least recently used), hard-referenced cache map.
Maps.ManagedCacheMap(Maps.AbstractCacheMap.ReferenceType valueReferenceType, java.lang.String name)
          Constructs an unbounded cache map of specified value reference type.
Maps.ManagedCacheMap(Maps.CacheStrategy<K,V,Maps.AbstractLinkedEntry<K,V>> strategy, java.lang.String name)
          Constructs a cache map with specified Maps.CacheStrategy.
Maps.ManagedCacheMap(java.lang.String name)
          Constructs an unbounded, hard-referenced value cache map.
 
Method Summary
 void clearKeyStatistics()
           
 boolean getCollectKeyStatistics()
           
 javax.management.openmbean.TabularData getKeyStatistics()
           
 int getMaximumSize()
           
 int getSize()
           
 javax.management.openmbean.CompositeData getStatistics()
           
 int getTotalKeyCount()
           
 void setCollectKeyStatistics(boolean collect)
           
 
Methods inherited from class oracle.javatools.util.Maps.CacheMap
createDefaultEntry, createSoftEntry, createWeakEntry
 
Methods inherited from class oracle.javatools.util.Maps.AbstractCacheMap
createEntry, entryAccessed, entryAdded, entryChanged, entryEvicted, entryPurged, entryRemoved, evictExistingEntry, getMappingType, getStrategy, getValueReferenceType, mapChanged, removeEldestEntry, setStrategy
 
Methods inherited from class oracle.javatools.util.Maps.AbstractLinkedHashMap
clear, createEntryIterator, createEntrySetIterator, createKeySetIterator, createValuesIterator, getEldestEntry
 
Methods inherited from class oracle.javatools.util.Maps.AbstractHashMap
addEntry, capacity, change, clone, containsKey, containsValue, entrySet, equals, get, getChangeCount, getEntry, getQueue, hashCode, isEmpty, keyEquals, keyHashCode, keySet, loadFactor, mapConstructed, mapInitialized, purge, purgeEntry, put, putAll, remove, removeExistingEntry, removeKey, size, toString, valueEquals, valueHashCode, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Maps.ManagedCacheMap

public Maps.ManagedCacheMap(java.lang.String name)
Constructs an unbounded, hard-referenced value cache map. The initial capacity and load factor are set to default values; the mapping type is noncanonical (as is typical for an unbounded cache).

Parameters:
name - The unique name of this cache.

Maps.ManagedCacheMap

public Maps.ManagedCacheMap(Maps.AbstractCacheMap.ReferenceType valueReferenceType,
                            java.lang.String name)
Constructs an unbounded cache map of specified value reference type. The initial capacity and load factor are set to default values; the mapping type is noncanonical (as is typical for an unbounded cache).


Maps.ManagedCacheMap

public Maps.ManagedCacheMap(int bound,
                            java.lang.String name)
Constructs a bounded LRU (least recently used), hard-referenced cache map. The initial capacity and load factor are set to default values; the mapping type is canonical.

Parameters:
bound - The maximum number of values to cache.

Maps.ManagedCacheMap

public Maps.ManagedCacheMap(int bound,
                            Maps.AbstractCacheMap.ReferenceType valueReferenceType,
                            java.lang.String name)
Constructs a bounded LRU (least recently used), hard-referenced cache map. The initial capacity and load factor are set to default values; the mapping type is canonical.

Parameters:
bound - The maximum number of values to cache.

Maps.ManagedCacheMap

public Maps.ManagedCacheMap(int bound,
                            Maps.AbstractCacheMap.MappingType mappingType,
                            java.lang.String name)
Constructs a bounded LRU (least recently used), hard-referenced, canonically-mapped, cache map. The initial capacity and load factor are set to default values.

Parameters:
bound - The maximum number of values to cache.

Maps.ManagedCacheMap

public Maps.ManagedCacheMap(Maps.CacheStrategy<K,V,Maps.AbstractLinkedEntry<K,V>> strategy,
                            java.lang.String name)
Constructs a cache map with specified Maps.CacheStrategy.

Method Detail

getSize

public int getSize()
Specified by:
getSize in interface Maps.ManagedCacheMapMBean

getMaximumSize

public int getMaximumSize()
Specified by:
getMaximumSize in interface Maps.ManagedCacheMapMBean

getStatistics

public javax.management.openmbean.CompositeData getStatistics()
                                                       throws javax.management.openmbean.OpenDataException
Specified by:
getStatistics in interface Maps.ManagedCacheMapMBean
Throws:
javax.management.openmbean.OpenDataException

setCollectKeyStatistics

public void setCollectKeyStatistics(boolean collect)
Specified by:
setCollectKeyStatistics in interface Maps.ManagedCacheMapMBean

getCollectKeyStatistics

public boolean getCollectKeyStatistics()
Specified by:
getCollectKeyStatistics in interface Maps.ManagedCacheMapMBean

getTotalKeyCount

public int getTotalKeyCount()
Specified by:
getTotalKeyCount in interface Maps.ManagedCacheMapMBean

getKeyStatistics

public javax.management.openmbean.TabularData getKeyStatistics()
                                                        throws javax.management.openmbean.OpenDataException
Specified by:
getKeyStatistics in interface Maps.ManagedCacheMapMBean
Throws:
javax.management.openmbean.OpenDataException

clearKeyStatistics

public void clearKeyStatistics()
Specified by:
clearKeyStatistics in interface Maps.ManagedCacheMapMBean

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

Copyright © 1997, 2009, Oracle. All rights reserved.