Package org.aspectj.weaver.tools
Class WeavingAdaptor
- java.lang.Object
-
- org.aspectj.weaver.tools.WeavingAdaptor
-
- All Implemented Interfaces:
IMessageContext
- Direct Known Subclasses:
ClassLoaderWeavingAdaptor
public class WeavingAdaptor extends Object implements IMessageContext
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classWeavingAdaptor.WeavingAdaptorMessageHolderprotected classWeavingAdaptor.WeavingAdaptorMessageWriter
-
Field Summary
Fields Modifier and Type Field Description protected ProtectionDomainactiveProtectionDomainprotected BcelWorldbcelWorldprotected WeavedClassCachecacheBcelObjectTypedelegateForCurrentClassprotected Map<String,IUnwovenClassFile>generatedClassesprotected GeneratedClassHandlergeneratedClassHandlerstatic StringSHOW_WEAVE_INFO_PROPERTYstatic StringTRACE_MESSAGES_PROPERTYprotected booleanverboseprotected BcelWeaverweaverstatic StringWEAVING_ADAPTOR_VERBOSE
-
Constructor Summary
Constructors Modifier Constructor Description protectedWeavingAdaptor()WeavingAdaptor(GeneratedClassHandler handler, URL[] classURLs, URL[] aspectURLs)WeavingAdaptor(WeavingClassLoader loader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaccept(String name, byte[] bytes)voidaddURL(URL url)protected voidcreateMessageHandler()protected booleandebug(String message)protected voiddisable()protected voiddump(String name, byte[] b, boolean before)protected voidenable()protected voidensureDelegateInitialized(String name, byte[] bytes)protected booleanerror(String message)protected booleanerror(String message, Throwable th)StringgetContextId()protected StringgetDumpDir()protected List<String>getFullClassPath(ClassLoader loader)protected IMessageHandlergetMessageHandler()IMessageHoldergetMessageHolder()protected booleaninfo(String message)protected voidinitializeCache(ClassLoader loader, List<String> aspects, GeneratedClassHandler existingClassHandler, IMessageHandler myMessageHandler)protected booleanisEnabled()voidsetActiveProtectionDomain(ProtectionDomain protectionDomain)protected voidsetMessageHandler(IMessageHandler mh)protected booleanshouldDump(String name, boolean before)protected booleanwarn(String message)protected booleanwarn(String message, Throwable th)byte[]weaveClass(String name, byte[] bytes)byte[]weaveClass(String name, byte[] bytes, boolean mustWeave)
-
-
-
Field Detail
-
WEAVING_ADAPTOR_VERBOSE
public static final String WEAVING_ADAPTOR_VERBOSE
- See Also:
- Constant Field Values
-
SHOW_WEAVE_INFO_PROPERTY
public static final String SHOW_WEAVE_INFO_PROPERTY
- See Also:
- Constant Field Values
-
TRACE_MESSAGES_PROPERTY
public static final String TRACE_MESSAGES_PROPERTY
- See Also:
- Constant Field Values
-
verbose
protected boolean verbose
-
bcelWorld
protected BcelWorld bcelWorld
-
weaver
protected BcelWeaver weaver
-
generatedClassHandler
protected GeneratedClassHandler generatedClassHandler
-
generatedClasses
protected Map<String,IUnwovenClassFile> generatedClasses
-
delegateForCurrentClass
public BcelObjectType delegateForCurrentClass
-
activeProtectionDomain
protected ProtectionDomain activeProtectionDomain
-
cache
protected WeavedClassCache cache
-
-
Constructor Detail
-
WeavingAdaptor
protected WeavingAdaptor()
-
WeavingAdaptor
public WeavingAdaptor(WeavingClassLoader loader)
-
WeavingAdaptor
public WeavingAdaptor(GeneratedClassHandler handler, URL[] classURLs, URL[] aspectURLs)
-
-
Method Detail
-
getFullClassPath
protected List<String> getFullClassPath(ClassLoader loader)
-
initializeCache
protected void initializeCache(ClassLoader loader, List<String> aspects, GeneratedClassHandler existingClassHandler, IMessageHandler myMessageHandler)
-
createMessageHandler
protected void createMessageHandler()
-
getMessageHandler
protected IMessageHandler getMessageHandler()
-
getMessageHolder
public IMessageHolder getMessageHolder()
-
setMessageHandler
protected void setMessageHandler(IMessageHandler mh)
-
disable
protected void disable()
-
enable
protected void enable()
-
isEnabled
protected boolean isEnabled()
-
addURL
public void addURL(URL url)
-
weaveClass
public byte[] weaveClass(String name, byte[] bytes) throws IOException
- Throws:
IOException
-
weaveClass
public byte[] weaveClass(String name, byte[] bytes, boolean mustWeave) throws IOException
- Throws:
IOException
-
accept
protected boolean accept(String name, byte[] bytes)
-
shouldDump
protected boolean shouldDump(String name, boolean before)
-
ensureDelegateInitialized
protected void ensureDelegateInitialized(String name, byte[] bytes)
-
debug
protected boolean debug(String message)
-
info
protected boolean info(String message)
-
warn
protected boolean warn(String message)
-
error
protected boolean error(String message)
-
getContextId
public String getContextId()
- Specified by:
getContextIdin interfaceIMessageContext
-
dump
protected void dump(String name, byte[] b, boolean before)
-
getDumpDir
protected String getDumpDir()
-
setActiveProtectionDomain
public void setActiveProtectionDomain(ProtectionDomain protectionDomain)
-
-