Top Description Inners Fields Constructors Methods
org.aspectj.apache.bcel.util

public Class NonCachingClassLoaderRepository

extends Object
implements Repository
Class Inheritance
All Implemented Interfaces
org.aspectj.apache.bcel.util.Repository
Imports
java.io.IOException, .InputStream, java.lang.ref.ReferenceQueue, .SoftReference, java.net.URL, .URLClassLoader, java.util.AbstractMap, .HashMap, .Map, .Set, org.aspectj.apache.bcel.classfile.ClassParser, .JavaClass

The repository maintains information about which classes have been loaded. It loads its data from the ClassLoader implementation passed into its constructor.
Authors
M. Dahm, David Dixon-Peugh
Version
$Id: NonCachingClassLoaderRepository.java,v 1.6 2009/09/09 19:56:20 aclement Exp $
See Also
org.aspectj.apache.bcel.Repository

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private static ClassLoader
private final Map<String, JavaClass>
private final ClassLoaderReference

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements org.aspectj.apache.bcel.util.Repository.clear.

Clear all entries from cache.
public JavaClass
findClass(String className)

Implements org.aspectj.apache.bcel.util.Repository.findClass.

Find an already defined JavaClass.
private static synchronized ClassLoader
public JavaClass
loadClass(String className)

Implements org.aspectj.apache.bcel.util.Repository.loadClass.

Lookup a JavaClass object from the Class Name provided.
public JavaClass
loadClass(Class<T> clazz)

Implements org.aspectj.apache.bcel.util.Repository.loadClass.

Find the JavaClass instance for the given run-time class object
private JavaClass
loadJavaClass(String className)

public void
removeClass(JavaClass clazz)

Implements org.aspectj.apache.bcel.util.Repository.removeClass.

Remove class from repository
public void
storeClass(JavaClass clazz)

Implements org.aspectj.apache.bcel.util.Repository.storeClass.

Store a new JavaClass into this Repository.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bootClassLoaderback to summary
private static ClassLoader bootClassLoader
loadedClassesback to summary
private final Map<String, JavaClass> loadedClasses
loaderRefback to summary
private final ClassLoaderReference loaderRef

Constructor Detail

NonCachingClassLoaderRepositoryback to summary
public NonCachingClassLoaderRepository(ClassLoader loader)
NonCachingClassLoaderRepositoryback to summary
public NonCachingClassLoaderRepository(ClassLoaderReference loaderRef)

Method Detail

clearback to summary
public void clear()

Implements org.aspectj.apache.bcel.util.Repository.clear.

Clear all entries from cache.

findClassback to summary
public JavaClass findClass(String className)

Implements org.aspectj.apache.bcel.util.Repository.findClass.

Find an already defined JavaClass.

getBootClassLoaderback to summary
private static synchronized ClassLoader getBootClassLoader()
loadClassback to summary
public JavaClass loadClass(String className) throws ClassNotFoundException

Implements org.aspectj.apache.bcel.util.Repository.loadClass.

Lookup a JavaClass object from the Class Name provided.

loadClassback to summary
public JavaClass loadClass(Class<T> clazz) throws ClassNotFoundException

Implements org.aspectj.apache.bcel.util.Repository.loadClass.

Doc from org.aspectj.apache.bcel.util.Repository.loadClass.

Find the JavaClass instance for the given run-time class object

loadJavaClassback to summary
private JavaClass loadJavaClass(String className) throws ClassNotFoundException
removeClassback to summary
public void removeClass(JavaClass clazz)

Implements org.aspectj.apache.bcel.util.Repository.removeClass.

Remove class from repository

storeClassback to summary
public void storeClass(JavaClass clazz)

Implements org.aspectj.apache.bcel.util.Repository.storeClass.

Store a new JavaClass into this Repository.

org.aspectj.apache.bcel.util back to summary

public Class NonCachingClassLoaderRepository.SoftHashMap

extends AbstractMap
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private Map<Object, NonCachingClassLoaderRepository.SoftHashMap.SpecialValue>
private ReferenceQueue<T>

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides java.util.AbstractMap.clear.

Implements java.util.Map.clear.

Removes all of the mappings from this map (optional operation).
public Set<E>
entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.
public Object
get(Object
the key whose associated value is to be returned
key
)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
private void
public Object
put(Object
key with which the specified value is to be associated
k
,
Object
value to be associated with the specified key
v
)

Overrides java.util.AbstractMap.put.

Implements java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation).
public Object
remove(Object
key whose mapping is to be removed from the map
k
)

Overrides java.util.AbstractMap.remove.

Implements java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation).
public int
size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Returns the number of key-value mappings in this map.
Inherited from java.util.AbstractMap:
clonecontainsKeycontainsValueequalshashCodeisEmptykeySetputAlltoStringvalues

Field Detail

mapback to summary
private Map<Object, NonCachingClassLoaderRepository.SoftHashMap.SpecialValue> map
rqback to summary
private ReferenceQueue<T> rq

Constructor Detail

SoftHashMapback to summary
public SoftHashMap(Map<Object, NonCachingClassLoaderRepository.SoftHashMap.SpecialValue> map)
SoftHashMapback to summary
public SoftHashMap()
SoftHashMapback to summary
public SoftHashMap(Map<Object, NonCachingClassLoaderRepository.SoftHashMap.SpecialValue> map, boolean b)

Method Detail

clearback to summary
public void clear()

Overrides java.util.AbstractMap.clear.

Implements java.util.Map.clear.

Doc from java.util.AbstractMap.clear.

Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.

Annotations
@Override
entrySetback to summary
public Set<E> entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.Map.entrySet.

Doc from java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:Set<E>

a set view of the mappings contained in this map

Annotations
@Override
getback to summary
public Object get(Object key)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Doc from java.util.AbstractMap.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that Objects.equals(key, k), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

If this map permits null values, then a return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Parameters
key:Object

Doc from java.util.Map.get.

the key whose associated value is to be returned

Returns:Object

Doc from java.util.Map.get.

the value to which the specified key is mapped, or null if this map contains no mapping for the key

Annotations
@Override
processQueueback to summary
private void processQueue()
putback to summary
public Object put(Object k, Object v)

Overrides java.util.AbstractMap.put.

Implements java.util.Map.put.

Doc from java.util.AbstractMap.put.

Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)

Parameters
k:Object

Doc from java.util.Map.put.

key with which the specified value is to be associated

v:Object

Doc from java.util.Map.put.

value to be associated with the specified key

Returns:Object

Doc from java.util.Map.put.

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)

Annotations
@Override
removeback to summary
public Object remove(Object k)

Overrides java.util.AbstractMap.remove.

Implements java.util.Map.remove.

Doc from java.util.AbstractMap.remove.

Removes the mapping for a key from this map if it is present (optional operation). More formally, if this map contains a mapping from key k to value v such that Objects.equals(key, k), that mapping is removed. (The map can contain at most one such mapping.)

Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.

If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.

The map will not contain a mapping for the specified key once the call returns.

Parameters
k:Object

Doc from java.util.Map.remove.

key whose mapping is to be removed from the map

Returns:Object

Doc from java.util.Map.remove.

the previous value associated with key, or null if there was no mapping for key.

Annotations
@Override
sizeback to summary
public int size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Doc from java.util.AbstractMap.size.

Returns the number of key-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

Doc from java.util.Map.size.

the number of key-value mappings in this map

Annotations
@Override
org.aspectj.apache.bcel.util back to summary

pack-priv Class NonCachingClassLoaderRepository.SoftHashMap.SpecialValue

extends SoftReference
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Object

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.ref.SoftReference:
get

Field Detail

keyback to summary
private final Object key

Constructor Detail

SpecialValueback to summary
pack-priv SpecialValue(Object k, Object v)