persistence.cache
Class SimpleCache

java.lang.Object
  extended bypersistence.cache.SimpleCache
All Implemented Interfaces:
Cache

public class SimpleCache
extends java.lang.Object
implements Cache

Eenvoudige implementatie van cache. Idealiter ook reference count, ...

Author:
bram 4-mrt-2004

Field Summary
private  java.util.Map deepObjects
           
private  java.util.Map shallowObjects
           
 
Constructor Summary
SimpleCache()
           
 
Method Summary
 boolean checkForDeepOID(ObjectID OID)
          Is deep object met OID al gecached?
 boolean checkForShallowOID(ObjectID OID)
          Is shallow object met OID al gecached?
 java.lang.Object readDeep(ObjectID OID)
          Read deep object with OID.
 java.lang.Object readShallow(ObjectID OID)
          Read shallow object with OID.
 void remove(ObjectID OID)
          Cache bevat persistente objecten.
 java.lang.String toString()
          Shows contents cache.
 void writeDeepToCache(ObjectID OID, java.lang.Object ob)
          Write deep object with OID.
 void writeShallowToCache(ObjectID OID, java.lang.Object ob)
          Write shallow object with OID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

deepObjects

private java.util.Map deepObjects

shallowObjects

private java.util.Map shallowObjects
Constructor Detail

SimpleCache

public SimpleCache()
Method Detail

readDeep

public java.lang.Object readDeep(ObjectID OID)
                          throws NotInCacheException
Description copied from interface: Cache
Read deep object with OID.

Specified by:
readDeep in interface Cache
Parameters:
OID -
Returns:
Throws:
NotInCacheException
See Also:
Cache.readDeep(persistence.type.ObjectID)

readShallow

public java.lang.Object readShallow(ObjectID OID)
                             throws NotInCacheException
Description copied from interface: Cache
Read shallow object with OID.

Specified by:
readShallow in interface Cache
Parameters:
OID -
Returns:
Throws:
NotInCacheException
See Also:
Cache.readShallow(persistence.type.ObjectID)

writeDeepToCache

public void writeDeepToCache(ObjectID OID,
                             java.lang.Object ob)
                      throws AlreadyInCacheException
Description copied from interface: Cache
Write deep object with OID.

Specified by:
writeDeepToCache in interface Cache
Parameters:
ob -
Throws:
AlreadyInCacheException
See Also:
persistence.cache.Cache#writeDeepToCache(persistence.type.Persistent)

writeShallowToCache

public void writeShallowToCache(ObjectID OID,
                                java.lang.Object ob)
                         throws AlreadyInCacheException
Description copied from interface: Cache
Write shallow object with OID.

Specified by:
writeShallowToCache in interface Cache
Parameters:
ob -
Throws:
AlreadyInCacheException
See Also:
persistence.cache.Cache#writeShallowToCache(persistence.type.Persistent)

checkForDeepOID

public boolean checkForDeepOID(ObjectID OID)
Description copied from interface: Cache
Is deep object met OID al gecached?

Specified by:
checkForDeepOID in interface Cache
Parameters:
OID -
Returns:
See Also:
Cache.checkForDeepOID(persistence.type.ObjectID)

checkForShallowOID

public boolean checkForShallowOID(ObjectID OID)
Description copied from interface: Cache
Is shallow object met OID al gecached?

Specified by:
checkForShallowOID in interface Cache
Parameters:
OID -
Returns:
See Also:
Cache.checkForShallowOID(persistence.type.ObjectID)

remove

public void remove(ObjectID OID)
Cache bevat persistente objecten. Eens verwijderd uit de DB, blijft de data wel transiënt bestaan in de JVM, maar niet meer in de cache.

Specified by:
remove in interface Cache
Parameters:
OID -
See Also:
Cache.remove(persistence.type.ObjectID)

toString

public java.lang.String toString()
Description copied from interface: Cache
Shows contents cache.

Specified by:
toString in interface Cache
See Also:
Object.toString()