org.aspectj.weaver.loadtime

Class ClassLoaderWeavingAdaptor

Implemented Interfaces:
IMessageContext

public class ClassLoaderWeavingAdaptor
extends WeavingAdaptor

Author:
Alexandre Vasseur

Nested Class Summary

Nested classes/interfaces inherited from class org.aspectj.weaver.tools.WeavingAdaptor

WeavingAdaptor.WeavingAdaptorMessageHolder, WeavingAdaptor.WeavingAdaptorMessageWriter

Field Summary

Fields inherited from class org.aspectj.weaver.tools.WeavingAdaptor

SHOW_WEAVE_INFO_PROPERTY, TRACE_MESSAGES_PROPERTY, WEAVING_ADAPTOR_VERBOSE, bcelWorld, delegateForCurrentClass, generatedClassHandler, generatedClasses, verbose, weaver

Constructor Summary

ClassLoaderWeavingAdaptor()
ClassLoaderWeavingAdaptor(ClassLoader deprecatedLoader, IWeavingContext deprecatedContext)
Deprecated.

Method Summary

protected boolean
accept(String className, byte[] bytes)
void
flushGeneratedClasses()
Flush the generated classes cache
boolean
generatedClassesExistFor(String className)
Check to see if any classes are stored in the generated classes cache.
String
getContextId()
String
getNamespace()
protected void
initialize(ClassLoader classLoader, IWeavingContext context)
protected void
lint(String name, String[] infos)
protected boolean
shouldDump(String className, boolean before)

Methods inherited from class org.aspectj.weaver.tools.WeavingAdaptor

accept, addURL, createMessageHandler, debug, disable, dump, enable, ensureDelegateInitialized, error, error, getContextId, getMessageHandler, getMessageHolder, info, isEnabled, setMessageHandler, shouldDump, warn, warn, weaveClass

Constructor Details

ClassLoaderWeavingAdaptor

public ClassLoaderWeavingAdaptor()

ClassLoaderWeavingAdaptor

public ClassLoaderWeavingAdaptor(ClassLoader deprecatedLoader,
                                 IWeavingContext deprecatedContext)

Deprecated.

We don't need a reference to the class loader and using it during construction can cause problems with recursion. It also makes sense to supply the weaving context during initialization to.

Method Details

accept

protected boolean accept(String className,
                         byte[] bytes)
Overrides:
accept in interface WeavingAdaptor

flushGeneratedClasses

public void flushGeneratedClasses()
Flush the generated classes cache

generatedClassesExistFor

public boolean generatedClassesExistFor(String className)
Check to see if any classes are stored in the generated classes cache. Then flush the cache if it is not empty
Parameters:
className - TODO
Returns:
true if a class has been generated and is stored in the cache

getContextId

public String getContextId()
Overrides:
getContextId in interface WeavingAdaptor

getNamespace

public String getNamespace()
Returns:
Returns the key.

initialize

protected void initialize(ClassLoader classLoader,
                          IWeavingContext context)

lint

protected void lint(String name,
                    String[] infos)

shouldDump

protected boolean shouldDump(String className,
                             boolean before)
Overrides:
shouldDump in interface WeavingAdaptor