|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.aspectj.weaver.tools.WeavingAdaptor
This adaptor allows the AspectJ compiler to be embedded in an existing system to facilitate load-time weaving. It provides an interface for a weaving class loader to provide a classpath to be woven by a set of aspects. A callback is supplied to allow a class loader to define classes generated by the compiler during the weaving process.
A weaving class loader should create a WeavingAdaptor
before
any classes are defined, typically during construction. The set of aspects
passed to the adaptor is fixed for the lifetime of the adaptor although the
classpath can be augmented. A system property can be set to allow verbose
weaving messages to be written to the console.
Field Summary | |
static String |
SHOW_WEAVE_INFO_PROPERTY
|
static String |
WEAVING_ADAPTOR_VERBOSE
System property used to turn on verbose weaving messages |
Constructor Summary | |
WeavingAdaptor(GeneratedClassHandler handler,
URL[] classURLs,
URL[] aspectURLs)
Construct a WeavingAdator with a reference to a GeneratedClassHandler , a full search path for resolving
classes and a complete set of aspects. |
|
WeavingAdaptor(WeavingClassLoader loader)
Construct a WeavingAdaptor with a reference to a weaving class loader. |
Method Summary | |
void |
addURL(URL url)
Appends URL to path used by the WeavingAdptor to resolve classes |
byte[] |
weaveClass(String name,
byte[] bytes)
Weave a class using aspects previously supplied to the adaptor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String WEAVING_ADAPTOR_VERBOSE
public static final String SHOW_WEAVE_INFO_PROPERTY
Constructor Detail |
public WeavingAdaptor(WeavingClassLoader loader)
loader
- instance of ClassLoader
public WeavingAdaptor(GeneratedClassHandler handler, URL[] classURLs, URL[] aspectURLs)
GeneratedClassHandler
, a full search path for resolving
classes and a complete set of aspects. The search path must include
classes loaded by the class loader constructing the WeavingAdaptor and
all its parents in the hierarchy.
handler
- GeneratedClassHandler
classURLs
- the URLs from which to resolve classesaspectURLs
- the aspects used to weave classes defined by this class loaderMethod Detail |
public void addURL(URL url)
url
- to be appended to search pathpublic byte[] weaveClass(String name, byte[] bytes) throws IOException
name
- the name of the classbytes
- the class bytes
IOException
- weave failed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |