org.deegree.feature.persistence.cache
Class SimpleFeatureStoreCache

java.lang.Object
  extended by org.deegree.feature.persistence.cache.SimpleFeatureStoreCache
All Implemented Interfaces:
FeatureStoreCache

public class SimpleFeatureStoreCache
extends Object
implements FeatureStoreCache

FeatureStoreCache that uses a Java's SoftReference as eviction strategy and allows to limit the maximum number of cached objects.

Version:
$Revision: 22192 $, $Date: 2010-01-25 20:00:06 +0100 (Mo, 25 Jan 2010) $
Author:
Markus Schneider, last edited by: $Author: mschneider $
See Also:
FeatureStore

Constructor Summary
SimpleFeatureStoreCache()
          Creates a new SimpleFeatureStoreCache instance that allows to store a default number of entries.
SimpleFeatureStoreCache(int maxEntries)
          Creates a new SimpleFeatureStoreCache instance that allows to store the specified number of entries.
 
Method Summary
 void add(GMLObject obj)
          Adds the given object to the cache.
 void clear()
          Clears the cache, removing all objects.
 GMLObject get(String id)
          Returns the object with the specified id (if it exists in the cache).
 void remove(String id)
          Removes the object with the specified id from the cache (if it exists).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFeatureStoreCache

public SimpleFeatureStoreCache()
Creates a new SimpleFeatureStoreCache instance that allows to store a default number of entries.


SimpleFeatureStoreCache

public SimpleFeatureStoreCache(int maxEntries)
Creates a new SimpleFeatureStoreCache instance that allows to store the specified number of entries.

Parameters:
maxEntries - maximum number of cached objects
Method Detail

get

public GMLObject get(String id)
Description copied from interface: FeatureStoreCache
Returns the object with the specified id (if it exists in the cache).

Specified by:
get in interface FeatureStoreCache
Parameters:
id - id of the object, must not be null
Returns:
the object with the specified id, or null if it is not present in the cache

add

public void add(GMLObject obj)
Description copied from interface: FeatureStoreCache
Adds the given object to the cache.

Specified by:
add in interface FeatureStoreCache
Parameters:
obj - object, must not be null

remove

public void remove(String id)
Description copied from interface: FeatureStoreCache
Removes the object with the specified id from the cache (if it exists).

Specified by:
remove in interface FeatureStoreCache
Parameters:
id - id of the object, must not be null

clear

public void clear()
Description copied from interface: FeatureStoreCache
Clears the cache, removing all objects.

Specified by:
clear in interface FeatureStoreCache


Copyright © 2011. All Rights Reserved.