org.aspectj.weaver.loadtime
Class WeavingURLClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.aspectj.weaver.bcel.ExtensibleURLClassLoader
                  extended by org.aspectj.weaver.loadtime.WeavingURLClassLoader
All Implemented Interfaces:
GeneratedClassHandler, WeavingClassLoader

public class WeavingURLClassLoader
extends ExtensibleURLClassLoader
implements WeavingClassLoader


Field Summary
static java.lang.String WEAVING_ASPECT_PATH
           
static java.lang.String WEAVING_CLASS_PATH
           
 
Constructor Summary
WeavingURLClassLoader(java.lang.ClassLoader parent)
           
WeavingURLClassLoader(java.net.URL[] urls, java.lang.ClassLoader parent)
           
WeavingURLClassLoader(java.net.URL[] classURLs, java.net.URL[] aspectURLs, java.lang.ClassLoader parent)
           
 
Method Summary
 void acceptClass(java.lang.String name, byte[] classBytes, byte[] weavedBytes)
          Accept class generated by WeavingAdaptor.
protected  void addURL(java.net.URL url)
           
protected  java.lang.Class defineClass(java.lang.String name, byte[] b, java.security.CodeSource cs)
          Override to weave class using WeavingAdaptor
 java.net.URL[] getAspectURLs()
          Implement method from WeavingClassLoader
protected  byte[] getBytes(java.lang.String name)
          Override to find classes generated by WeavingAdaptor
 
Methods inherited from class org.aspectj.weaver.bcel.ExtensibleURLClassLoader
findClass
 
Methods inherited from class java.net.URLClassLoader
definePackage, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEAVING_CLASS_PATH

public static final java.lang.String WEAVING_CLASS_PATH
See Also:
Constant Field Values

WEAVING_ASPECT_PATH

public static final java.lang.String WEAVING_ASPECT_PATH
See Also:
Constant Field Values
Constructor Detail

WeavingURLClassLoader

public WeavingURLClassLoader(java.lang.ClassLoader parent)

WeavingURLClassLoader

public WeavingURLClassLoader(java.net.URL[] urls,
                             java.lang.ClassLoader parent)

WeavingURLClassLoader

public WeavingURLClassLoader(java.net.URL[] classURLs,
                             java.net.URL[] aspectURLs,
                             java.lang.ClassLoader parent)
Method Detail

addURL

protected void addURL(java.net.URL url)
Overrides:
addURL in class ExtensibleURLClassLoader

defineClass

protected java.lang.Class defineClass(java.lang.String name,
                                      byte[] b,
                                      java.security.CodeSource cs)
                               throws java.io.IOException
Override to weave class using WeavingAdaptor

Overrides:
defineClass in class ExtensibleURLClassLoader
Throws:
java.io.IOException

getBytes

protected byte[] getBytes(java.lang.String name)
                   throws java.io.IOException
Override to find classes generated by WeavingAdaptor

Overrides:
getBytes in class ExtensibleURLClassLoader
Throws:
java.io.IOException

getAspectURLs

public java.net.URL[] getAspectURLs()
Implement method from WeavingClassLoader

Specified by:
getAspectURLs in interface WeavingClassLoader
Returns:
the aspects used for weaving classes.

acceptClass

public void acceptClass(java.lang.String name,
                        byte[] classBytes,
                        byte[] weavedBytes)
Description copied from interface: GeneratedClassHandler
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
classBytes - original class bytes
weavedBytes - woven class bytes