net.sf.jso.cache
Class JSOObjectDataCache

java.lang.Object
  extended bynet.sf.jso.cache.JSOObjectDataCache
All Implemented Interfaces:
ObjectDataCache

public class JSOObjectDataCache
extends java.lang.Object
implements ObjectDataCache

Object caching management classes.


Constructor Summary
JSOObjectDataCache(int cacheSize)
          Constructs the cache.
 
Method Summary
 ObjectData get(OID oid)
          Gets an object's data in the cache.
 CacheInfo getCacheInfo()
          Gets cache information.
 void invalidate()
          Invalidates all cached data.
 void invalidate(java.lang.Class cls)
          Invalidates all data of objects of a class.
 void invalidate(OID oid)
          Invalidates an object's data.
 ObjectData put(ObjectData data)
          Puts an object's data in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSOObjectDataCache

public JSOObjectDataCache(int cacheSize)
Constructs the cache.

Parameters:
cacheSize - Size of the cache.
Method Detail

put

public ObjectData put(ObjectData data)
Puts an object's data in the cache.

Specified by:
put in interface ObjectDataCache
Parameters:
data - Object's data.

get

public ObjectData get(OID oid)
Gets an object's data in the cache.

Specified by:
get in interface ObjectDataCache
Parameters:
oid - Object's identification.
Returns:
If an object associated with the supplied oid is found its data is returned. Otherwise null is returned.

invalidate

public void invalidate()
Invalidates all cached data.

Specified by:
invalidate in interface ObjectDataCache

getCacheInfo

public CacheInfo getCacheInfo()
Gets cache information.

Specified by:
getCacheInfo in interface ObjectDataCache
Returns:
Information about the cache.

invalidate

public void invalidate(OID oid)
Invalidates an object's data.

Specified by:
invalidate in interface ObjectDataCache
Parameters:
oid - Object's identification.

invalidate

public void invalidate(java.lang.Class cls)
Invalidates all data of objects of a class.

Specified by:
invalidate in interface ObjectDataCache
Parameters:
cls - The class of the objects.