org.apache.ojb.broker.cache
Class InternalCache

java.lang.Object
  extended byorg.apache.ojb.broker.cache.InternalCache
All Implemented Interfaces:
ObjectCache

public class InternalCache
extends java.lang.Object
implements ObjectCache

A wrapper class for ObjectCache implementation. This class is used as a workaround for a concurrency materialization problem with shared cache implementations. To avoid passing of partial materialized objects to cache this class act as a temporary storage for unmaterialized (read) objects.
TODO: Will be replaced on cache refactoring

Version:
$Id: InternalCache.java,v 1.1 2004/02/06 13:01:52 arminw Exp $
Author:
Armin Waibel

Constructor Summary
InternalCache(ObjectCache realCache)
           
 
Method Summary
 void cache(Identity oid, java.lang.Object obj)
          makes object obj persistent to the Objectcache under the key oid.
 void clear()
          clear the ObjectCache.
 void disableMaterializationCache()
           
 void enableMaterializationCache()
           
 void localClear()
           
 java.lang.Object lookup(Identity oid)
          Lookup object with Identity oid in objectTable.
 void remove(Identity oid)
          removes an Object from the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalCache

public InternalCache(ObjectCache realCache)
Method Detail

enableMaterializationCache

public void enableMaterializationCache()

disableMaterializationCache

public void disableMaterializationCache()

cache

public void cache(Identity oid,
                  java.lang.Object obj)
Description copied from interface: ObjectCache
makes object obj persistent to the Objectcache under the key oid.

Specified by:
cache in interface ObjectCache

lookup

public java.lang.Object lookup(Identity oid)
Description copied from interface: ObjectCache
Lookup object with Identity oid in objectTable. returns null if no matching id is found

Specified by:
lookup in interface ObjectCache

remove

public void remove(Identity oid)
Description copied from interface: ObjectCache
removes an Object from the cache.

Specified by:
remove in interface ObjectCache
Parameters:
oid - Identity of the object to be removed.

localClear

public void localClear()

clear

public void clear()
Description copied from interface: ObjectCache
clear the ObjectCache.

Specified by:
clear in interface ObjectCache


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14