Class NullLevel2Cache

  • All Implemented Interfaces:
    java.io.Serializable, Level2Cache

    public class NullLevel2Cache
    extends AbstractLevel2Cache
    Null implementation of a Level 2 Cache. Does nothing when its methods are invoked.
    See Also:
    Serialized Form
    • Constructor Detail

      • NullLevel2Cache

        public NullLevel2Cache​(NucleusContext nucleusCtx)
    • Method Detail

      • close

        public void close()
        Method to close the cache when no longer needed. Provides a hook to release resources etc.
      • evict

        public void evict​(java.lang.Object oid)
        Evict the parameter instance from the second-level cache.
        Parameters:
        oid - the object id of the instance to evict.
      • evictAll

        public void evictAll()
        Evict the parameter instances from the second-level cache. All instances in the PersistenceManager's cache are evicted from the second-level cache.
      • evictAll

        public void evictAll​(java.lang.Class pcClass,
                             boolean subclasses)
        Evict the parameter instances from the second-level cache.
        Parameters:
        pcClass - the class to evict
        subclasses - Whether to evict all subclasses of this class also
      • evictAll

        public void evictAll​(java.util.Collection oids)
        Evict the parameter instances from the second-level cache.
        Parameters:
        oids - the object ids of the instance to evict.
      • evictAll

        public void evictAll​(java.lang.Object[] oids)
        Evict the parameter instances from the second-level cache.
        Parameters:
        oids - the object ids of the instances to evict
      • containsOid

        public boolean containsOid​(java.lang.Object oid)
        Accessor for whether an object with the specified id is in the cache
        Parameters:
        oid - The object id
        Returns:
        Whether it is in the cache
      • get

        public CachedPC get​(java.lang.Object oid)
        Accessor for an object from the cache
        Parameters:
        oid - The identity
        Returns:
        The cacheable object
      • getSize

        public int getSize()
        Description copied from interface: Level2Cache
        Accessor for the total number of objects in the L2 cache.
        Returns:
        Number of objects
        See Also:
        Level2Cache.getSize()
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: Level2Cache
        Accessor for whether the cache is empty.
        Returns:
        Whether it is empty.
        See Also:
        Level2Cache.isEmpty()
      • put

        public CachedPC put​(java.lang.Object oid,
                            CachedPC pc)
        Method to put an object in the L2 cache
        Parameters:
        oid - The identity
        pc - Cacheable form of the PC
        Returns:
        Previous value stored for this id