goldengate.common.lru
Class SoftReferenceSynchronizedLruCache<K,V>

java.lang.Object
  extended by goldengate.common.lru.AbstractLruCache<K,V>
      extended by goldengate.common.lru.SynchronizedLruCache<K,V>
          extended by goldengate.common.lru.SoftReferenceSynchronizedLruCache<K,V>
All Implemented Interfaces:
InterfaceLruCache<K,V>

public class SoftReferenceSynchronizedLruCache<K,V>
extends SynchronizedLruCache<K,V>

Modification of SynchronizedLruCache which uses SoftReference to store values

Author:
Frederic Bregier, Damian Momot

Field Summary
 
Fields inherited from class goldengate.common.lru.SynchronizedLruCache
DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR
 
Constructor Summary
SoftReferenceSynchronizedLruCache(int capacity, long ttl)
           
SoftReferenceSynchronizedLruCache(int capacity, long ttl, int initialCapacity)
           
SoftReferenceSynchronizedLruCache(int capacity, long ttl, int initialCapacity, float loadFactor)
           
 
Method Summary
protected  InterfaceLruCacheEntry<V> createEntry(V value, long ttl)
          Creates new LruCacheEntry.
 
Methods inherited from class goldengate.common.lru.SynchronizedLruCache
clear, forceClearOldest, get, getCapacity, getEntry, getSize, put, putEntry, remove
 
Methods inherited from class goldengate.common.lru.AbstractLruCache
contains, get, get, getTtl, getValue, isEmpty, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoftReferenceSynchronizedLruCache

public SoftReferenceSynchronizedLruCache(int capacity,
                                         long ttl,
                                         int initialCapacity,
                                         float loadFactor)

SoftReferenceSynchronizedLruCache

public SoftReferenceSynchronizedLruCache(int capacity,
                                         long ttl,
                                         int initialCapacity)

SoftReferenceSynchronizedLruCache

public SoftReferenceSynchronizedLruCache(int capacity,
                                         long ttl)
Method Detail

createEntry

protected InterfaceLruCacheEntry<V> createEntry(V value,
                                                long ttl)
Description copied from class: AbstractLruCache
Creates new LruCacheEntry. It can be used to change implementation of LruCacheEntry

Overrides:
createEntry in class AbstractLruCache<K,V>
Returns:
LruCacheEntry


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.