org.aspectj.weaver.loadtime

Class WeavingURLClassLoader

Implemented Interfaces:
GeneratedClassHandler, WeavingClassLoader

public class WeavingURLClassLoader
extends org.aspectj.weaver.ExtensibleURLClassLoader
implements WeavingClassLoader

Field Summary

static String
WEAVING_ASPECT_PATH
static String
WEAVING_CLASS_PATH

Constructor Summary

WeavingURLClassLoader(ClassLoader parent)
WeavingURLClassLoader(URL[] urls, ClassLoader parent)
WeavingURLClassLoader(URL[] classURLs, URL[] aspectURLs, ClassLoader parent)

Method Summary

void
acceptClass(String name, byte[] bytes)
Accept class generated by WeavingAdaptor.
protected void
addURL(URL url)
protected Class
defineClass(String name, byte[] b, CodeSource cs)
Override to weave class using WeavingAdaptor
URL[]
getAspectURLs()
Implement method from WeavingClassLoader
protected byte[]
getBytes(String name)
Override to find classes generated by WeavingAdaptor

Methods inherited from class org.aspectj.weaver.ExtensibleURLClassLoader

addURL, defineClass, findClass, getBytes

Field Details

WEAVING_ASPECT_PATH

public static final String WEAVING_ASPECT_PATH

WEAVING_CLASS_PATH

public static final String WEAVING_CLASS_PATH

Constructor Details

WeavingURLClassLoader

public WeavingURLClassLoader(ClassLoader parent)

WeavingURLClassLoader

public WeavingURLClassLoader(URL[] urls,
                             ClassLoader parent)

WeavingURLClassLoader

public WeavingURLClassLoader(URL[] classURLs,
                             URL[] aspectURLs,
                             ClassLoader parent)

Method Details

acceptClass

public void acceptClass(String name,
                        byte[] bytes)
Accept class generated by WeavingAdaptor. The class loader should store the class definition in its local cache until called upon to load it.
Specified by:
acceptClass in interface GeneratedClassHandler
Parameters:
name - class name
bytes - class definition

addURL

protected void addURL(URL url)
Overrides:
addURL in interface org.aspectj.weaver.ExtensibleURLClassLoader

defineClass

protected Class defineClass(String name,
                            byte[] b,
                            CodeSource cs)
            throws IOException
Override to weave class using WeavingAdaptor
Overrides:
defineClass in interface org.aspectj.weaver.ExtensibleURLClassLoader

getAspectURLs

public URL[] getAspectURLs()
Implement method from WeavingClassLoader
Specified by:
getAspectURLs in interface WeavingClassLoader

getBytes

protected byte[] getBytes(String name)
            throws IOException
Override to find classes generated by WeavingAdaptor
Overrides:
getBytes in interface org.aspectj.weaver.ExtensibleURLClassLoader