Class LocalCache.ManualSerializationProxy<K,​V>

  • All Implemented Interfaces:
    Cache<K,​V>, java.io.Serializable
    Direct Known Subclasses:
    LocalCache.LoadingSerializationProxy
    Enclosing class:
    LocalCache<K,​V>

    static class LocalCache.ManualSerializationProxy<K,​V>
    extends ForwardingCache<K,​V>
    implements java.io.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.

    • Field Detail

      • keyEquivalence

        final Equivalence<java.lang.Object> keyEquivalence
      • valueEquivalence

        final Equivalence<java.lang.Object> valueEquivalence
      • expireAfterWriteNanos

        final long expireAfterWriteNanos
      • expireAfterAccessNanos

        final long expireAfterAccessNanos
      • maxWeight

        final long maxWeight
      • concurrencyLevel

        final int concurrencyLevel
      • delegate

        transient Cache<K,​V> delegate
    • Method Detail

      • readObject

        private void readObject​(java.io.ObjectInputStream in)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • readResolve

        private java.lang.Object readResolve()
      • delegate

        protected Cache<K,​V> 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 as ForwardingSet.delegate(). Concrete subclasses override this method to supply the instance being decorated.
        Specified by:
        delegate in class ForwardingCache<K,​V>