Package com.google.common.cache
Class LocalCache.ManualSerializationProxy<K,V>
java.lang.Object
com.google.common.collect.ForwardingObject
com.google.common.cache.ForwardingCache<K,V>
com.google.common.cache.LocalCache.ManualSerializationProxy<K,V>
- All Implemented Interfaces:
Cache<K,
,V> Serializable
- Direct Known Subclasses:
LocalCache.LoadingSerializationProxy
- Enclosing class:
LocalCache<K,
V>
static class LocalCache.ManualSerializationProxy<K,V>
extends ForwardingCache<K,V>
implements Serializable
Serializes the configuration of a LocalCache, reconstituting it as a Cache using CacheBuilder
upon deserialization. An instance of this class is fit for use by the writeReplace of
LocalManualCache.
Unfortunately, readResolve() doesn't get called when a circular dependency is present, so the proxy must be able to behave as the cache itself.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.cache.ForwardingCache
ForwardingCache.SimpleForwardingCache<K,
V> -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int
(package private) final long
(package private) final long
(package private) final Equivalence
<Object> (package private) final LocalCache.Strength
(package private) final CacheLoader
<? super K, V> (package private) final long
(package private) final RemovalListener
<? super K, ? super V> private static final long
(package private) final Ticker
(package private) final Equivalence
<Object> (package private) final LocalCache.Strength
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ManualSerializationProxy
(LocalCache.Strength keyStrength, LocalCache.Strength valueStrength, Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence, long expireAfterWriteNanos, long expireAfterAccessNanos, long maxWeight, Weigher<K, V> weigher, int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener, Ticker ticker, CacheLoader<? super K, V> loader) (package private)
ManualSerializationProxy
(LocalCache<K, V> cache) -
Method Summary
Modifier and TypeMethodDescriptiondelegate()
Returns the backing delegate instance that methods are forwarded to.private void
private Object
(package private) CacheBuilder
<K, V> Methods inherited from class com.google.common.cache.ForwardingCache
asMap, cleanUp, get, getAllPresent, getIfPresent, invalidate, invalidateAll, invalidateAll, put, putAll, size, stats
Methods inherited from class com.google.common.collect.ForwardingObject
toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
keyStrength
-
valueStrength
-
keyEquivalence
-
valueEquivalence
-
expireAfterWriteNanos
final long expireAfterWriteNanos -
expireAfterAccessNanos
final long expireAfterAccessNanos -
maxWeight
final long maxWeight -
weigher
-
concurrencyLevel
final int concurrencyLevel -
removalListener
-
ticker
-
loader
-
delegate
-
-
Constructor Details
-
ManualSerializationProxy
ManualSerializationProxy(LocalCache<K, V> cache) -
ManualSerializationProxy
private ManualSerializationProxy(LocalCache.Strength keyStrength, LocalCache.Strength valueStrength, Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence, long expireAfterWriteNanos, long expireAfterAccessNanos, long maxWeight, Weigher<K, V> weigher, int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener, Ticker ticker, CacheLoader<? super K, V> loader)
-
-
Method Details
-
recreateCacheBuilder
CacheBuilder<K,V> recreateCacheBuilder() -
readObject
- Throws:
IOException
ClassNotFoundException
-
readResolve
-
delegate
Description copied from class:ForwardingObject
Returns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such asForwardingSet.delegate()
. Concrete subclasses override this method to supply the instance being decorated.- Specified by:
delegate
in classForwardingCache<K,
V>
-