org.aspectj.weaver.loadtime

Class Aj

Implemented Interfaces:
ClassPreProcessor

public class Aj
extends java.lang.Object
implements ClassPreProcessor

Adapter between the generic class pre processor interface and the AspectJ weaver Load time weaving consistency relies on Bcel.setRepository
Author:
Alexandre Vasseur

Constructor Summary

Aj()
Aj(IWeavingContext context)

Method Summary

void
flushGeneratedClasses(ClassLoader loader)
boolean
generatedClassesExist(ClassLoader loader)
Check to see if any classes have been generated for a particular classes loader.
String
getNamespace(ClassLoader loader)
Returns a namespace based on the contest of the aspects available
void
initialize()
Initialization
byte[]
preProcess(String className, byte[] bytes, ClassLoader loader)
Weave

Constructor Details

Aj

public Aj()

Aj

public Aj(IWeavingContext context)

Method Details

flushGeneratedClasses

public void flushGeneratedClasses(ClassLoader loader)

generatedClassesExist

public boolean generatedClassesExist(ClassLoader loader)
Check to see if any classes have been generated for a particular classes loader. Calls ClassLoaderWeavingAdaptor.generatedClassesExist()
Parameters:
loader - the class cloder
Returns:
true if classes have been generated.

getNamespace

public String getNamespace(ClassLoader loader)
Returns a namespace based on the contest of the aspects available

initialize

public void initialize()
Initialization
Specified by:
initialize in interface ClassPreProcessor

preProcess

public byte[] preProcess(String className,
                         byte[] bytes,
                         ClassLoader loader)
Weave
Specified by:
preProcess in interface ClassPreProcessor
Parameters:
className -
bytes -
loader -
Returns:
weaved bytes