org.apache.jetspeed.decoration.caches
Class HashMapPathResolverCache

java.lang.Object
  extended by org.apache.jetspeed.decoration.caches.HashMapPathResolverCache
All Implemented Interfaces:
PathResolverCache
Direct Known Subclasses:
SessionPathResolverCache

public class HashMapPathResolverCache
extends java.lang.Object
implements PathResolverCache

Uses a java.util.HashMap to cache previously located resources pathes.

Author:
Scott T. Weaver

Field Summary
protected  java.util.Map cache
           
 
Constructor Summary
HashMapPathResolverCache()
           
 
Method Summary
 void addPath(java.lang.String key, java.lang.String path)
          Adds a recolved path to the the cache using its relative path as the key
 void clear()
          Clears the entire contents of this cache object.
 java.lang.String getPath(java.lang.String key)
          Returns a previously located path using its retlative path as the code.
 java.lang.String removePath(java.lang.String key)
          Removes a full path to a resource from the cache using its relative path as the key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected java.util.Map cache
Constructor Detail

HashMapPathResolverCache

public HashMapPathResolverCache()
Method Detail

addPath

public void addPath(java.lang.String key,
                    java.lang.String path)
Description copied from interface: PathResolverCache
Adds a recolved path to the the cache using its relative path as the key

Specified by:
addPath in interface PathResolverCache
Parameters:
key - key relative path of the resource.
path - full path to resource

getPath

public java.lang.String getPath(java.lang.String key)
Description copied from interface: PathResolverCache
Returns a previously located path using its retlative path as the code.

Specified by:
getPath in interface PathResolverCache
Parameters:
key - relative path of the resource.
Returns:
full path to resource or null if no resource for the key exists.

removePath

public java.lang.String removePath(java.lang.String key)
Description copied from interface: PathResolverCache
Removes a full path to a resource from the cache using its relative path as the key.

Specified by:
removePath in interface PathResolverCache
Returns:
The full path to the resource or null if the resource path was not cached.

clear

public void clear()
Description copied from interface: PathResolverCache
Clears the entire contents of this cache object.

Specified by:
clear in interface PathResolverCache


Copyright © 1999-2010 Apache Software Foundation. All Rights Reserved.