The Spring Framework

org.springframework.core.type.classreading
Class CachingMetadataReaderFactory

java.lang.Object
  extended by org.springframework.core.type.classreading.SimpleMetadataReaderFactory
      extended by org.springframework.core.type.classreading.CachingMetadataReaderFactory
All Implemented Interfaces:
MetadataReaderFactory

public class CachingMetadataReaderFactory
extends SimpleMetadataReaderFactory

Caching implementation of the MetadataReaderFactory interface, caching an ASM ClassReader per Spring Resource handle (i.e. per ".class" file).

Since:
2.5
Author:
Juergen Hoeller

Constructor Summary
CachingMetadataReaderFactory()
          Create a new CachingMetadataReaderFactory for the default class loader.
CachingMetadataReaderFactory(ClassLoader classLoader)
          Create a new CachingMetadataReaderFactory for the given class loader.
CachingMetadataReaderFactory(ResourceLoader resourceLoader)
          Create a new CachingMetadataReaderFactory for the given resource loader.
 
Method Summary
 MetadataReader getMetadataReader(Resource resource)
          Obtain a MetadataReader for the given resource.
 
Methods inherited from class org.springframework.core.type.classreading.SimpleMetadataReaderFactory
getMetadataReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingMetadataReaderFactory

public CachingMetadataReaderFactory()
Create a new CachingMetadataReaderFactory for the default class loader.


CachingMetadataReaderFactory

public CachingMetadataReaderFactory(ResourceLoader resourceLoader)
Create a new CachingMetadataReaderFactory for the given resource loader.

Parameters:
resourceLoader - the Spring ResourceLoader to use (also determines the ClassLoader to use)

CachingMetadataReaderFactory

public CachingMetadataReaderFactory(ClassLoader classLoader)
Create a new CachingMetadataReaderFactory for the given class loader.

Parameters:
classLoader - the ClassLoader to use
Method Detail

getMetadataReader

public MetadataReader getMetadataReader(Resource resource)
                                 throws IOException
Description copied from interface: MetadataReaderFactory
Obtain a MetadataReader for the given resource.

Specified by:
getMetadataReader in interface MetadataReaderFactory
Overrides:
getMetadataReader in class SimpleMetadataReaderFactory
Parameters:
resource - the resource (pointing to a ".class" file)
Returns:
a holder for the ClassReader instance (never null)
Throws:
IOException - in case of I/O failure

The Spring Framework

Copyright © 2002-2007 The Spring Framework.