Top Fields Constructors Methods
org.springframework.cglib.core.internal

public Class LoadingCache<K, KK, V>

extends Object
Class Inheritance
Annotations
@SuppressWarnings:rawtypes, unchecked
Imports
java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, .ExecutionException, .FutureTask

Field Summary

Modifier and TypeField and Description
public static final Function<K, V>
protected final Function<K, KK>
protected final Function<K, V>
protected final ConcurrentMap<KK, Object>

Constructor Summary

AccessConstructor and Description
public
LoadingCache(Function<K, KK> keyMapper, Function<K, V> loader)

Method Summary

Modifier and TypeMethod and Description
protected V

Returns:

newly created instance
createEntry
(final K
original key that would be used to load the instance
key
,
KK
key that would be used to store the entry in internal map
cacheKey
,
Object v)

Loads entry to the cache.

public V
get(K key)

public static <K> Function<K, K>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

IDENTITYback to summary
public static final Function<K, V> IDENTITY
keyMapperback to summary
protected final Function<K, KK> keyMapper
loaderback to summary
protected final Function<K, V> loader
mapback to summary
protected final ConcurrentMap<KK, Object> map

Constructor Detail

LoadingCacheback to summary
public LoadingCache(Function<K, KK> keyMapper, Function<K, V> loader)

Method Detail

createEntryback to summary
protected V createEntry(final K key, KK cacheKey, Object v)

Loads entry to the cache. If entry is missing, put FutureTask first so other competing thread might wait for the result.

Parameters
key:K

original key that would be used to load the instance

cacheKey:KK

key that would be used to store the entry in internal map

v:Object

null or FutureTask<V>

Returns:V

newly created instance

getback to summary
public V get(K key)
identityback to summary
public static <K> Function<K, K> identity()
Annotations
@SuppressWarnings:unchecked