Top Description Fields Constructors Methods
com.fasterxml.classmate.util

public Class ConcurrentTypeCache

extends ResolvedTypeCache
Class Inheritance
Imports
java.util.concurrent.ConcurrentHashMap, com.fasterxml.classmate.ResolvedType

Alternative ResolvedTypeCache implementation that uses ConcurrentHashMap for efficient concurrent access and limits maximum entry count to specified maximum. But instead of trying to optimize retention by access (as LRUTypeCache does, will simply clear (remove all entries) if maximum size is reached. This works well as long as maximum size is large enough to cover most commonly resolved types, and works well for higher concurrency use cases.
See Also
LRUTypeCache

Field Summary

Modifier and TypeField and Description
protected final transient ConcurrentHashMap<ResolvedTypeKey, ResolvedType>
protected final int
private static final long

Constructor Summary

AccessConstructor and Description
public
ConcurrentTypeCache(int maxEntries)

Method Summary

Modifier and TypeMethod and Description
public ResolvedType
public void
pack-priv Object
public int
Inherited from com.fasterxml.classmate.util.ResolvedTypeCache:
_addForTestconcurrentCachekeykeylruCache

Field Detail

_mapback to summary
protected final transient ConcurrentHashMap<ResolvedTypeKey, ResolvedType> _map
_maxEntriesback to summary
protected final int _maxEntries
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ConcurrentTypeCacheback to summary
public ConcurrentTypeCache(int maxEntries)

Method Detail

findback to summary
public ResolvedType find(ResolvedTypeKey key)

Implements abstract com.fasterxml.classmate.util.ResolvedTypeCache.find.

Annotations
@Override
putback to summary
public void put(ResolvedTypeKey key, ResolvedType type)

Implements abstract com.fasterxml.classmate.util.ResolvedTypeCache.put.

Annotations
@Override
readResolveback to summary
pack-priv Object readResolve()
sizeback to summary
public int size()

Implements abstract com.fasterxml.classmate.util.ResolvedTypeCache.size.

Annotations
@Override