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.
LRUTypeCache
| Modifier and Type | Field and Description |
|---|---|
| protected final transient ConcurrentHashMap | |
| protected final int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ResolvedType | |
| public void | put(ResolvedTypeKey key, ResolvedType type)
Implements abstract com. |
| pack-priv Object | |
| public int |
| _map | back to summary |
|---|---|
| protected final transient ConcurrentHashMap<ResolvedTypeKey, ResolvedType> _map | |
| _maxEntries | back to summary |
|---|---|
| protected final int _maxEntries | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| ConcurrentTypeCache | back to summary |
|---|---|
| public ConcurrentTypeCache(int maxEntries) | |
| find | back to summary |
|---|---|
| public ResolvedType find(ResolvedTypeKey key) Implements abstract com.
| |
| put | back to summary |
|---|---|
| public void put(ResolvedTypeKey key, ResolvedType type) Implements abstract com.
| |
| readResolve | back to summary |
|---|---|
| pack-priv Object readResolve() | |
| size | back to summary |
|---|---|
| public int size() Implements abstract com.
| |