Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.datacache
Class DataCacheImpl

    java.lang.Object
      |
      +--serp.util.AbstractEventManager
            |
            +--kodo.datacache.AbstractDataCache
                  |
                  +--kodo.datacache.DataCacheImpl

All Implemented Interfaces:
  com.solarmetric.util.Closeable, Configurable, DataCache, RemoteCommitListener

public class DataCacheImpl
extends AbstractDataCache
implements RemoteCommitListener

A PersistenceManagerFactory cache implementation. Commits are performed atomically.

Fields inherited from class kodo.datacache.AbstractDataCache
`conf, log`

Fields inherited from interface kodo.datacache.DataCache
`DEFAULT_NAME`

Constructor Summary
`DataCacheImpl()`

Method Summary
`protected void` | `clearInternal()` Clear the cache.
`void` | `endConfiguration()` Invoked upon completion of bean property configuration for this object.
`CacheMap` | `getCacheMap()` Returns the underlying `CacheMap` that this `DataCacheImpl` is using.
`int` | `getCacheSize()` Returns the maximum number of unpinned objects to keep hard references to.
`String` | `getEvictionTimes()` Return a comma separated list of scheduled eviction times.
`protected DataCachePCData` | `getInternal(Object key)` Return the object for the given oid.
`int` | `getSoftReferenceSize()` Returns the maximum number of unpinned objects to keep soft references to.
`protected boolean` | `pinInternal(Object key)` Pin an object to the cache.
`protected DataCachePCData` | `putInternal(Object key, DataCachePCData pc)` Add the given object to the cache, returning the old object under the given oid.
`void` | `removeAllInternal(Class cls, boolean subclasses)` Evict objects in cache by class.
`protected DataCachePCData` | `removeInternal(Object key)` Remove the object under the given oid from the cache.
`void` | `setCacheSize(int size)` Sets the maximum number of unpinned objects to keep hard references to.
`void` | `setEvictionTimes(String times)` Set a comma separated list of eviction times when all elements in the cache should be evicted.
`void` | `setSoftReferenceSize(int size)` Sets the maximum number of unpinned objects to keep soft references to.
`protected boolean` | `unpinInternal(Object key)` Unpin an object from the cache.

Methods inherited from class kodo.datacache.AbstractDataCache
`addExpirationListener, afterCommit, clear, close, closeWithoutClear, commit, contains, containsAll, fireEvent, get, getEvictionSchedule, getHitRate, getHits, getMisses, getName, getStatistics, getStatisticsString, initialize, isClosed, keyRemoved, pin, pinAll, put, putAllInternal, recacheUpdates, remove, removeAll, removeAll, removeAllClassNamesInternal, removeAllInternal, removeExpirationListener, resetStatistics, setConfiguration, setEvictionSchedule, setName, startConfiguration, toString, unpin, unpinAll, update`

Methods inherited from class serp.util.AbstractEventManager
`fireEvent, getListeners, hasListener, hasListeners, newListenerCollection, registerListener, removeListener`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface kodo.event.RemoteCommitListener
`afterCommit, close`

Constructor Detail

### DataCacheImpl

    public DataCacheImpl()

Method Detail

### getCacheMap

    public CacheMap getCacheMap()

  Returns the underlying `CacheMap` that this `DataCacheImpl` is using. This is not an unmodifiable view on the map, so care should be taken with this reference. Implementations should probably not modify the contents of the cache, but should only use this reference to obtain cache metrics.

### setCacheSize

    public void setCacheSize(int size)

  Sets the maximum number of unpinned objects to keep hard references to. If the map contains more unpinned objects than `size`, then this method will result in the cache flushing old values.

### getCacheSize

    public int getCacheSize()

  Returns the maximum number of unpinned objects to keep hard references to.

### setSoftReferenceSize

    public void setSoftReferenceSize(int size)

  Sets the maximum number of unpinned objects to keep soft references to. If the map contains more soft references than `size`, then this method will result in the cache flushing values.

### getSoftReferenceSize

    public int getSoftReferenceSize()

  Returns the maximum number of unpinned objects to keep soft references to. Defaults to `-1`.

### setEvictionTimes

    public void setEvictionTimes(String times)

  Set a comma separated list of eviction times when all elements in the cache should be evicted.

### getEvictionTimes

    public String getEvictionTimes()

  Return a comma separated list of scheduled eviction times. Defaults to `null`

### getInternal

    protected DataCachePCData getInternal(Object key)

  Description copied from class: `AbstractDataCache`
  Return the object for the given oid.
  Overrides:
    `getInternal` in class `AbstractDataCache`

### putInternal

    protected DataCachePCData putInternal(Object key,
                                          DataCachePCData pc)

  Description copied from class: `AbstractDataCache`
  Add the given object to the cache, returning the old object under the given oid.
  Overrides:
    `putInternal` in class `AbstractDataCache`

### removeInternal

    protected DataCachePCData removeInternal(Object key)

  Description copied from class: `AbstractDataCache`
  Remove the object under the given oid from the cache.
  Overrides:
    `removeInternal` in class `AbstractDataCache`

### removeAllInternal

    public void removeAllInternal(Class cls,
                                  boolean subclasses)

  Description copied from class: `AbstractDataCache`
  Evict objects in cache by class.
  Overrides:
    `removeAllInternal` in class `AbstractDataCache`

### clearInternal

    protected void clearInternal()

  Description copied from class: `AbstractDataCache`
  Clear the cache.
  Overrides:
    `clearInternal` in class `AbstractDataCache`

### pinInternal

    protected boolean pinInternal(Object key)

  Description copied from class: `AbstractDataCache`
  Pin an object to the cache.
  Overrides:
    `pinInternal` in class `AbstractDataCache`

### unpinInternal

    protected boolean unpinInternal(Object key)

  Description copied from class: `AbstractDataCache`
  Unpin an object from the cache.
  Overrides:
    `unpinInternal` in class `AbstractDataCache`

### endConfiguration

    public void endConfiguration()

  Description copied from interface: `Configurable`
  Invoked upon completion of bean property configuration for this object.
  Overrides:
    `endConfiguration` in class `AbstractDataCache`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.