Top Fields Constructors Methods
org.aspectj.weaver.bcel

public abstract Class ExtensibleURLClassLoader

extends URLClassLoader
Class Inheritance
Known Direct Subclasses
org.aspectj.weaver.loadtime.WeavingURLClassLoader
Imports
java.io.IOException, java.net.URL, .URLClassLoader, java.security.CodeSource, org.aspectj.util.FileUtil, org.aspectj.weaver.BCException, .UnresolvedType

Field Summary

Modifier and TypeField and Description
private ClassPathManager

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
addURL(URL
the URL to be added to the search path of URLs
url
)

Overrides java.net.URLClassLoader.addURL.

Appends the specified URL to the list of URLs to search for classes and resources.
public void
close()

Overrides java.net.URLClassLoader.close.

Implements java.io.Closeable.close.

Closes this URLClassLoader, so that it can no longer be used to load new classes or resources that are defined by this loader.
protected Class<T>
defineClass(String name, byte[] b, CodeSource cs)

private Class<?>
defineClass(String name, byte[] bytes)

protected Class<T>
findClass(String
the name of the class
name
)

Overrides java.net.URLClassLoader.findClass.

Finds and loads the class with the specified name from the URL search path.
protected byte[]
private String
Inherited from java.net.URLClassLoader:
definePackagefindResourcefindResourcesgetPermissionsgetResourceAsStreamgetURLsnewInstancenewInstance

Field Detail

classPathback to summary
private ClassPathManager classPath

Constructor Detail

ExtensibleURLClassLoaderback to summary
public ExtensibleURLClassLoader(URL[] urls, ClassLoader parent)

Method Detail

addURLback to summary
protected void addURL(URL url)

Overrides java.net.URLClassLoader.addURL.

Doc from java.net.URLClassLoader.addURL.

Appends the specified URL to the list of URLs to search for classes and resources.

If the URL specified is null or is already in the list of URLs, or if this loader is closed, then invoking this method has no effect.

Parameters
url:URL

the URL to be added to the search path of URLs

closeback to summary
public void close() throws IOException

Overrides java.net.URLClassLoader.close.

Implements java.io.Closeable.close.

Doc from java.net.URLClassLoader.close.

Closes this URLClassLoader, so that it can no longer be used to load new classes or resources that are defined by this loader. Classes and resources defined by any of this loader's parents in the delegation hierarchy are still accessible. Also, any classes or resources that are already loaded, are still accessible.

In the case of jar: and file: URLs, it also closes any files that were opened by it. If another thread is loading a class when the close method is invoked, then the result of that load is undefined.

The method makes a best effort attempt to close all opened files, by catching IOExceptions internally. Unchecked exceptions and errors are not caught. Calling close on an already closed loader has no effect.

Annotations
@Override
Exceptions
IOException:
if closing any file opened by this class loader resulted in an IOException. Any such exceptions are caught internally. If only one is caught, then it is re-thrown. If more than one exception is caught, then the second and following exceptions are added as suppressed exceptions of the first one caught, which is then re-thrown.
defineClassback to summary
protected Class<T> defineClass(String name, byte[] b, CodeSource cs) throws IOException
defineClassback to summary
private Class<?> defineClass(String name, byte[] bytes) throws IOException
findClassback to summary
protected Class<T> findClass(String name) throws ClassNotFoundException

Overrides java.net.URLClassLoader.findClass.

Doc from java.net.URLClassLoader.findClass.

Finds and loads the class with the specified name from the URL search path. Any URLs referring to JAR files are loaded and opened as needed until the class is found.

Parameters
name:String

the name of the class

Returns:Class<T>

the resulting class

Exceptions
ClassNotFoundException:
if the class could not be found, or if the loader is closed.
getBytesback to summary
protected byte[] getBytes(String name) throws IOException
getPackageNameback to summary
private String getPackageName(String className)