wt.cache
Class DirtyCache

java.lang.Object
  extended byjava.util.AbstractMap
      extended bywt.util.Cache
          extended bywt.cache.DirtyCache
All Implemented Interfaces:
Map

Deprecated. Replaced by wt.cache.DirtyMap

Supported API: false

Extendable: false

public class DirtyCache
extends Cache

putLater and removeLater maintain thread-local caches of modifications until the current transaction is completed.

addListener and removeListener allow DirtyCacheListeners to receive notifications of puts and removes.


Nested Class Summary
static interface DirtyCache.DirtyCacheListener
          Deprecated. Notified by putLater, putAllLater, remoteLater, and removeAllLater when changes to mappings are commited to the shared cache.
static class DirtyCache.DirtyCacheListenerAdapter
          Deprecated. Convenience base class for listener implementations.
(package private) static class DirtyCache.DirtyMapListenerAdapter
          Deprecated.  
 
Nested classes inherited from class wt.util.Cache
Cache.CacheEntry
 
Nested classes inherited from class java.util.AbstractMap
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Field Summary
private  DirtyMap dirtyMap
          Deprecated.  
 
Fields inherited from class wt.util.Cache
agedOut, cacheSize, count, hashCodes, hits, keys, misses, modCount, tableSize, values
 
Constructor Summary
DirtyCache(int size)
          Deprecated. Constructs a cache with a private context key
DirtyCache(int size, Object context_key)
          Deprecated.  
 
Method Summary
 void addListener(DirtyCache.DirtyCacheListener listener)
          Deprecated.  
 Object getDirty(Object key)
          Deprecated. Check thread-local cache.
 void putAllLater(Map mappings, Object placeholder)
          Deprecated. Puts all the mappings in the given map into the cache, following the same semantics as putLater(Object,Object,Object).
 void putLater(Object key, Object value, Object placeholder)
          Deprecated. Keeps change in thread-local cache until the current transaction commits.
 void removeAll(Collection keys)
          Deprecated. Convenience method that removes all the mappings for the keys in the given collection
 void removeAllLater(Collection keys)
          Deprecated. Removes all the keys in the given set, following the semantics of removeLater(Object)
 void removeLater(Object key)
          Deprecated. Overridden to keep change in thread-local cache until the current transaction commits
 void removeListener(DirtyCache.DirtyCacheListener listener)
          Deprecated.  
 
Methods inherited from class wt.util.Cache
clear, containsKey, containsValue, createEntry, entries, entrySet, find, get, getAndRemove, getAndReplace, getKeys, keySet, link, overflow, print, put, remove, size, toString, touch
 
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, putAll, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dirtyMap

private DirtyMap dirtyMap
Deprecated. 
Constructor Detail

DirtyCache

public DirtyCache(int size)
Deprecated. 
Constructs a cache with a private context key


DirtyCache

public DirtyCache(int size,
                  Object context_key)
Deprecated. 
Method Detail

getDirty

public Object getDirty(Object key)
Deprecated. 
Check thread-local cache. If that does not contain the key, then check global cache.

Returns:
The object that maps to the given key

putLater

public void putLater(Object key,
                     Object value,
                     Object placeholder)
              throws WTException
Deprecated. 
Keeps change in thread-local cache until the current transaction commits. If placeholder is non-null, then only modifies the cache if the key still maps to the local placeholder. This allows for the detection of concurrent modification of the key by another thread.

Warning: This method must be called from within an active transaction

Throws:
WTException

putAllLater

public void putAllLater(Map mappings,
                        Object placeholder)
                 throws WTException
Deprecated. 
Puts all the mappings in the given map into the cache, following the same semantics as putLater(Object,Object,Object). The implementation assumes that each key in the given map is cuurrently assigned to the placeholder parameter.

Parameters:
mappings - The mappings that should be added to the cache
placeholder - The placeholder to use
Throws:
WTException

removeAll

public void removeAll(Collection keys)
Deprecated. 
Convenience method that removes all the mappings for the keys in the given collection

Parameters:
keys - The keys to remove mappings for

removeLater

public void removeLater(Object key)
                 throws WTException
Deprecated. 
Overridden to keep change in thread-local cache until the current transaction commits

Warning: This method must be called from within an active transaction

Throws:
WTException

removeAllLater

public void removeAllLater(Collection keys)
                    throws WTException
Deprecated. 
Removes all the keys in the given set, following the semantics of removeLater(Object)

Throws:
WTException

addListener

public void addListener(DirtyCache.DirtyCacheListener listener)
Deprecated. 

removeListener

public void removeListener(DirtyCache.DirtyCacheListener listener)
Deprecated.