org.apache.velocity.util.introspection
Class IntrospectorCacheImpl

java.lang.Object
  extended by org.apache.velocity.util.introspection.IntrospectorCacheImpl
All Implemented Interfaces:
IntrospectorCache

public final class IntrospectorCacheImpl
extends Object
implements IntrospectorCache

This is the internal introspector cache implementation.

Version:
$Id: IntrospectorCacheImpl.java 477003 2006-11-20 01:14:22Z henning $
Author:
Henning P. Schmiedehausen

Constructor Summary
IntrospectorCacheImpl(Log log)
          C'tor
 
Method Summary
 void addListener(IntrospectorCacheListener listener)
          Register a Cache listener.
 void clear()
          Clears the internal cache.
 ClassMap get(Class c)
          Lookup a given Class object in the cache.
 ClassMap put(Class c)
          Creates a class map for specific class and registers it in the cache.
 void removeListener(IntrospectorCacheListener listener)
          Remove a Cache listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntrospectorCacheImpl

public IntrospectorCacheImpl(Log log)
C'tor

Method Detail

clear

public void clear()
Clears the internal cache.

Specified by:
clear in interface IntrospectorCache

get

public ClassMap get(Class c)
Lookup a given Class object in the cache. If it does not exist, check whether this is due to a class change and purge the caches eventually.

Specified by:
get in interface IntrospectorCache
Parameters:
c - The class to look up.
Returns:
A ClassMap object or null if it does not exist in the cache.

put

public ClassMap put(Class c)
Creates a class map for specific class and registers it in the cache. Also adds the qualified name to the name->class map for later Classloader change detection.

Specified by:
put in interface IntrospectorCache
Parameters:
c - The class for which the class map gets generated.
Returns:
A ClassMap object.

addListener

public void addListener(IntrospectorCacheListener listener)
Register a Cache listener.

Specified by:
addListener in interface IntrospectorCache
Parameters:
listener - A Cache listener object.

removeListener

public void removeListener(IntrospectorCacheListener listener)
Remove a Cache listener.

Specified by:
removeListener in interface IntrospectorCache
Parameters:
listener - A Cache listener object.


Copyright © 2000-2007 The Apache Software Foundation. All Rights Reserved.