org.nakedobjects.object
Class ThreadCachePolicy

java.lang.Object
  extended byorg.nakedobjects.object.ThreadCachePolicy
All Implemented Interfaces:
CachePolicy

public class ThreadCachePolicy
extends java.lang.Object
implements CachePolicy

Class responsible for caching NakedObjects per thread.

Author:
Dave Slaughter

Constructor Summary
ThreadCachePolicy()
           
 
Method Summary
 void add(NakedObject object)
          Add a NakedObject to the cache.
 void clear()
          Clear the cache.
 boolean contains(java.lang.Object oid)
          Return true if cache contains object
 java.lang.String dump()
          Dump the contents of the cache.
 NakedObject get(java.lang.Object oid)
          Retrieve a NakedObject from the cache.
 void remove(NakedObject object)
          Remove a NakedObject to the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadCachePolicy

public ThreadCachePolicy()
Method Detail

add

public void add(NakedObject object)
Add a NakedObject to the cache.

Specified by:
add in interface CachePolicy
Parameters:
object - the NakedObject to add to the cache

clear

public void clear()
Clear the cache.

Specified by:
clear in interface CachePolicy

contains

public boolean contains(java.lang.Object oid)
Return true if cache contains object

Specified by:
contains in interface CachePolicy
Parameters:
oid - the OID of the NakedObject

dump

public java.lang.String dump()
Dump the contents of the cache.

Specified by:
dump in interface CachePolicy

get

public NakedObject get(java.lang.Object oid)
Retrieve a NakedObject from the cache.

Specified by:
get in interface CachePolicy
Parameters:
oid - the OID of the NakedObject to get

remove

public void remove(NakedObject object)
Remove a NakedObject to the cache.

Specified by:
remove in interface CachePolicy
Parameters:
object - the NakedObject to remove