org.aspectj.weaver.loadtime
Class ClassLoaderWeavingAdaptor
java.lang.Object
org.aspectj.weaver.tools.WeavingAdaptor
org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor
- All Implemented Interfaces:
- IMessageContext
public class ClassLoaderWeavingAdaptor
- extends WeavingAdaptor
Fields inherited from class org.aspectj.weaver.tools.WeavingAdaptor |
activeProtectionDomain, bcelWorld, cache, delegateForCurrentClass, generatedClasses, generatedClassHandler, SHOW_WEAVE_INFO_PROPERTY, TRACE_MESSAGES_PROPERTY, verbose, weaver, WEAVING_ADAPTOR_VERBOSE |
Method Summary |
protected boolean |
accept(java.lang.String className,
byte[] bytes)
Determine whether a type should be accepted for weaving, by checking it against any includes/excludes. |
void |
flushGeneratedClasses()
Flush the generated classes cache |
boolean |
generatedClassesExistFor(java.lang.String className)
Check to see if any classes are stored in the generated classes cache. |
java.lang.String |
getContextId()
|
protected java.lang.String |
getDumpDir()
|
java.lang.String |
getNamespace()
|
void |
initialize(java.lang.ClassLoader classLoader,
IWeavingContext context)
|
protected void |
lint(java.lang.String name,
java.lang.String[] infos)
|
protected boolean |
shouldDump(java.lang.String className,
boolean before)
|
Methods inherited from class org.aspectj.weaver.tools.WeavingAdaptor |
addURL, createMessageHandler, debug, disable, dump, enable, ensureDelegateInitialized, error, error, getFullClassPath, getMessageHandler, getMessageHolder, info, initializeCache, isEnabled, setActiveProtectionDomain, setMessageHandler, warn, warn, weaveClass, weaveClass |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassLoaderWeavingAdaptor
public ClassLoaderWeavingAdaptor()
ClassLoaderWeavingAdaptor
public ClassLoaderWeavingAdaptor(java.lang.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.
initialize
public void initialize(java.lang.ClassLoader classLoader,
IWeavingContext context)
lint
protected void lint(java.lang.String name,
java.lang.String[] infos)
getContextId
public java.lang.String getContextId()
- Specified by:
getContextId
in interface IMessageContext
- Overrides:
getContextId
in class WeavingAdaptor
accept
protected boolean accept(java.lang.String className,
byte[] bytes)
- Determine whether a type should be accepted for weaving, by checking it against any includes/excludes.
- Overrides:
accept
in class WeavingAdaptor
- Parameters:
className
- the name of the type to possibly acceptbytes
- the bytecode for the type (in case we need to look inside, eg. annotations)
- Returns:
- true if it should be accepted for weaving
shouldDump
protected boolean shouldDump(java.lang.String className,
boolean before)
- Overrides:
shouldDump
in class WeavingAdaptor
getDumpDir
protected java.lang.String getDumpDir()
- Overrides:
getDumpDir
in class WeavingAdaptor
- Returns:
- the directory in which to dump - default is _ajdump but it
getNamespace
public java.lang.String getNamespace()
- Returns:
- Returns the key.
generatedClassesExistFor
public boolean generatedClassesExistFor(java.lang.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
flushGeneratedClasses
public void flushGeneratedClasses()
- Flush the generated classes cache