org.jpox.cache
Interface Level2Cache

All Superinterfaces:
javax.jdo.datastore.DataStoreCache
All Known Implementing Classes:
DefaultLevel2Cache, NullLevel2Cache

public interface Level2Cache
extends javax.jdo.datastore.DataStoreCache

Interface for any Level 2 Cache used by JPOX. Builds on the JDO definition, to provide the typical controls required by JPOX itself. Clearly users will be able to access these, but then they provide added value over JDO 2.

Version:
$Revision: 1.6 $

Nested Class Summary
static class Level2Cache.PinnedClass
          Representation of a class whose objects will be pinned when put into the L2 cache.
 
Nested classes inherited from class javax.jdo.datastore.DataStoreCache
javax.jdo.datastore.DataStoreCache.EmptyDataStoreCache
 
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 cache.
 
Methods inherited from interface javax.jdo.datastore.DataStoreCache
evict, evictAll, evictAll, evictAll, evictAll, pin, pinAll, pinAll, pinAll, unpin, unpinAll, unpinAll, unpinAll
 

Method Detail

getNumberOfPinnedObjects

public int getNumberOfPinnedObjects()
Accessor for the number of pinned objects in the cache.

Returns:
Number of pinned objects

getNumberOfUnpinnedObjects

public int getNumberOfUnpinnedObjects()
Accessor for the number of unpinned objects in the cache.

Returns:
Number of unpinned objects

getSize

public int getSize()
Accessor for the total number of objects in the L2 cache.

Returns:
Number of objects

get

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

Parameters:
oid - The Object ID
Returns:
The L2 cacheable object

put

public CachedPC put(java.lang.Object oid,
                    CachedPC pc)
Method to put an object in the cache.

Parameters:
oid - The Object id for this object
pc - The L2 cacheable PersistenceCapable object
Returns:
The value previously associated with this oid

isEmpty

public boolean isEmpty()
Accessor for whether the cache is empty.

Returns:
Whether it is empty.

clear

public void clear()
Method to clear the cache.


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


Copyright © -2007 . All Rights Reserved.