Class WeakLevel2Cache

  • All Implemented Interfaces:
    Serializable, Level2Cache

    public class WeakLevel2Cache
    extends AbstractReferencedLevel2Cache
    Weak referenced implementation of a Level 2 cache.

    Operates with 3 maps internally. One stores all pinned objects that have been selected to be retained by user's application. The second stores all other objects, and is the default location where objects are placed when being added here, using weak references meaning that they can get garbage collected as necessary by the JVM. The third stores objects keyed by the unique key that they relate to.

    Maintains collections of the classes and the identities that are to be pinned if they ever are put into the cache. These are defined by the pinAll(), pin() methods.

    All mutating methods, and the get method have been synchronized to prevent conflicts.

    See Also:
    Serialized Form