org.jpox.cache
Class NullLevel2Cache

java.lang.Object
  extended byjavax.jdo.datastore.DataStoreCache.EmptyDataStoreCache
      extended byorg.jpox.cache.NullLevel2Cache
All Implemented Interfaces:
javax.jdo.datastore.DataStoreCache, Level2Cache

public class NullLevel2Cache
extends javax.jdo.datastore.DataStoreCache.EmptyDataStoreCache
implements Level2Cache

Null implementation of a Level 2 Cache. Exists to meet the JDO 2 spec which states that the PMF will return a DataStoreCache that silently does nothing when its methods are called. Extends the JDO2 spec provided EmptyDataStoreCache to provide the add-on JPOX methods.

Version:
$Revision: 1.7 $

Nested Class Summary
 
Nested classes inherited from class org.jpox.cache.Level2Cache
Level2Cache.PinnedClass
 
Nested classes inherited from class javax.jdo.datastore.DataStoreCache
javax.jdo.datastore.DataStoreCache.EmptyDataStoreCache
 
Constructor Summary
NullLevel2Cache()
           
 
Method Summary
 void clear()
          Method to clear the cache.
 boolean containsOid(java.lang.Object oid)
          Accessor for whether an object with the specified id is in the cache
 CachedPC get(java.lang.Object oid)
          Accessor for an object from the cache
 int getNumberOfPinnedObjects()
          Accessor for the number of pinned objects in the cache.
 int getNumberOfUnpinnedObjects()
          Accessor for the number of unpinned objects in the cache.
 int getSize()
          Accessor for the total number of objects in the L2 cache.
 boolean isEmpty()
          Accessor for whether the cache is empty.
 CachedPC put(java.lang.Object oid, CachedPC pc)
          Method to put an object in the L2 cache
 
Methods inherited from class javax.jdo.datastore.DataStoreCache.EmptyDataStoreCache
evict, evictAll, evictAll, evictAll, evictAll, pin, pinAll, pinAll, pinAll, unpin, unpinAll, unpinAll, unpinAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jdo.datastore.DataStoreCache
evict, evictAll, evictAll, evictAll, evictAll, pin, pinAll, pinAll, pinAll, unpin, unpinAll, unpinAll, unpinAll
 

Constructor Detail

NullLevel2Cache

public NullLevel2Cache()
Method Detail

clear

public void clear()
Description copied from interface: Level2Cache
Method to clear the cache.

Specified by:
clear in interface Level2Cache
See Also:
Level2Cache.clear()

containsOid

public boolean containsOid(java.lang.Object oid)
Description copied from interface: Level2Cache
Accessor for whether an object with the specified id is in the cache

Specified by:
containsOid in interface Level2Cache
Parameters:
oid - The object id
Returns:
Whether it is in the cache
See Also:
Level2Cache.containsOid(java.lang.Object)

get

public CachedPC get(java.lang.Object oid)
Accessor for an object from the cache

Specified by:
get in interface Level2Cache
Parameters:
oid - The identity
Returns:
The cacheable object

getNumberOfPinnedObjects

public int getNumberOfPinnedObjects()
Description copied from interface: Level2Cache
Accessor for the number of pinned objects in the cache.

Specified by:
getNumberOfPinnedObjects in interface Level2Cache
Returns:
Number of pinned objects
See Also:
Level2Cache.getNumberOfPinnedObjects()

getNumberOfUnpinnedObjects

public int getNumberOfUnpinnedObjects()
Description copied from interface: Level2Cache
Accessor for the number of unpinned objects in the cache.

Specified by:
getNumberOfUnpinnedObjects in interface Level2Cache
Returns:
Number of unpinned objects
See Also:
Level2Cache.getNumberOfUnpinnedObjects()

getSize

public int getSize()
Description copied from interface: Level2Cache
Accessor for the total number of objects in the L2 cache.

Specified by:
getSize in interface Level2Cache
Returns:
Number of objects
See Also:
Level2Cache.getSize()

isEmpty

public boolean isEmpty()
Description copied from interface: Level2Cache
Accessor for whether the cache is empty.

Specified by:
isEmpty in interface Level2Cache
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

Specified by:
put in interface Level2Cache
Parameters:
oid - The identity
pc - Cacheable form of the PC
Returns:
Previous value stored for this id


Copyright © -2007 . All Rights Reserved.