Class JavaxCacheLevel2Cache

    • Constructor Detail

      • JavaxCacheLevel2Cache

        public JavaxCacheLevel2Cache​(NucleusContext nucleusCtx)
        Constructor.
        Parameters:
        nucleusCtx - Context
    • Method Detail

      • close

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

        public boolean containsOid​(Object oid)
        Accessor for whether the cache contains the specified id.
        Parameters:
        oid - The object id
        Returns:
        Whether it is in the cache
        See Also:
        Level2Cache.containsOid(java.lang.Object)
      • getAll

        public Map<Object,​CachedPC> getAll​(Collection oids)
        Description copied from interface: Level2Cache
        Accessor for a collection of objects from the cache.
        Parameters:
        oids - The Object IDs
        Returns:
        Map of the objects, keyed by the oids that are found
      • put

        public CachedPC put​(Object oid,
                            CachedPC pc)
        Method to add an object to the cache under its id
        Parameters:
        oid - The identity
        pc - The cacheable object
        Returns:
        The value previously associated with this oid
      • putAll

        public void putAll​(Map<Object,​CachedPC> objs)
        Description copied from interface: Level2Cache
        Method to put several objects into the cache.
        Parameters:
        objs - Map of cacheable object keyed by its oid.
      • evict

        public void evict​(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​(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​(Object[] oids)
        Evict the parameter instances from the second-level cache.
        Parameters:
        oids - the object ids of the instance to evict.
      • evictAll

        public void evictAll​(Class pcClass,
                             boolean subclasses)
        Evict the parameter instances from the second-level cache.
        Parameters:
        pcClass - the class of instances to evict
        subclasses - if true, evict instances of subclasses also
      • getUnique

        public CachedPC getUnique​(CacheUniqueKey key)
        Description copied from interface: Level2Cache
        Method to retrieve the id represented by the specified unique key.
        Parameters:
        key - Unique key
        Returns:
        The "identity" of the object that this unique key represents
      • putUnique

        public CachedPC putUnique​(CacheUniqueKey key,
                                  CachedPC pc)
        Description copied from interface: Level2Cache
        Method to store a persistable object for this unique key.
        Parameters:
        key - The unique key
        pc - The representation of the persistable object to cache
        Returns:
        The previous object for this unique key if one was present, otherwise null
      • putUniqueAll

        public void putUniqueAll​(Map<CacheUniqueKey,​CachedPC> objs)
        Description copied from interface: Level2Cache
        Method to put several objects into the cache.
        Parameters:
        objs - Map of cacheable object keyed by the unique keys.
      • removeUnique

        public void removeUnique​(CacheUniqueKey key)
        Description copied from interface: Level2Cache
        Method to remove any object cached against the provided unique key.
        Parameters:
        key - Unique key