org.exolab.castor.persist.cache
Class NoCache

java.lang.Object
  extended byorg.exolab.castor.persist.cache.AbstractBaseCache
      extended byorg.exolab.castor.persist.cache.NoCache
All Implemented Interfaces:
Cache

public class NoCache
extends AbstractBaseCache
implements Cache

NoCache is a Map which dispose all object right the way.

Every object being put in the Map will be disposed.

Method dispose(Object) will be called whenever an old object is diposed. Developer can get notify by overriding the dispose method dispose(Object).

Version:
$Revision: 1.3 $ $Date: 2004/06/08 09:51:30 $
Author:
Werner Guttmann

Constructor Summary
NoCache()
          Creates an instance of this class.
 
Method Summary
 boolean contains(java.lang.Object key)
          Indicates whether the cache holds value object mapped to the specified key.
protected  void dispose(java.lang.Object o)
          This method is called when an object is disposed.
 java.util.Enumeration elements()
          Returns an enumeration of the values in this LRU map.
 void expire(java.lang.Object key)
          Remove the object identified by key from the cache.
 java.lang.Object get(java.lang.Object key)
          Returns the value to which the specified key is mapped in this Map.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Maps the specified key to the specified value in this Map.
 java.lang.Object remove(java.lang.Object key)
          Removes the key (and its corresponding value) from this Map.
 
Methods inherited from class org.exolab.castor.persist.cache.AbstractBaseCache
getCacheType, getCapacity, getClassName, setCacheType, setCapacity, setClassName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.exolab.castor.persist.cache.Cache
getCacheType, getCapacity, getClassName, setCacheType, setCapacity, setClassName
 

Constructor Detail

NoCache

public NoCache()
Creates an instance of this class.

Method Detail

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Maps the specified key to the specified value in this Map. Neither the key nor the value can be null. End of theory.

Every object being put in the Map will be disposed.

Specified by:
put in interface Cache
Specified by:
put in class AbstractBaseCache
Parameters:
key - the Map key.
value - the value.
Returns:
the previous value of the specified key in this Map, or null if it did not have one.
Throws:
java.lang.NullPointerException - if the key or value is null.

get

public java.lang.Object get(java.lang.Object key)
Returns the value to which the specified key is mapped in this Map.

Specified by:
get in interface Cache
Specified by:
get in class AbstractBaseCache
Parameters:
key - - a key in the Map.
Returns:
the value to which the key is mapped in this Map; null if the key is not mapped to any value in this Map.

remove

public java.lang.Object remove(java.lang.Object key)
Removes the key (and its corresponding value) from this Map. This method does nothing if the key is not in the Map.

Specified by:
remove in interface Cache
Specified by:
remove in class AbstractBaseCache
Parameters:
key - the key that needs to be removed.
Returns:
the value to which the key had been mapped in this Map, or null if the key did not have a mapping.

elements

public java.util.Enumeration elements()
Returns an enumeration of the values in this LRU map. Use the Enumeration methods on the returned object to fetch the elements sequentially.

Specified by:
elements in interface Cache
Specified by:
elements in class AbstractBaseCache
Returns:
an enumeration of the values in this Map.
See Also:
Enumeration

expire

public void expire(java.lang.Object key)
Remove the object identified by key from the cache.

Specified by:
expire in interface Cache
Specified by:
expire in class AbstractBaseCache
Parameters:
key - the key that needs to be removed.

dispose

protected void dispose(java.lang.Object o)
This method is called when an object is disposed. Override this method if you interested in the disposed object.

Parameters:
o - Objec to be disposed.

contains

public boolean contains(java.lang.Object key)
Indicates whether the cache holds value object mapped to the specified key.

Specified by:
contains in interface Cache
Specified by:
contains in class AbstractBaseCache
Parameters:
key - - A key identifying a value object.
Returns:
True if the cache holds a value object for the specified key, false otherwise.
See Also:
Cache.contains(java.lang.Object)


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com