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.
| Modifier and Type | Class and Description |
|---|---|
| protected class | WeavingAdaptor.WeavingAdaptorMessageHolder
Processes messages arising from weaver operations. |
| protected class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| protected ProtectionDomain | |
| private static final String | |
| protected BcelWorld | |
| protected WeavedClassCache | |
| public BcelObjectType | |
| private boolean | |
| protected Map | |
| protected GeneratedClassHandler | |
| private boolean | |
| private static final int | |
| private IMessageHandler | |
| private WeavingAdaptor. | |
| private static final String | |
| public static final String | |
| private static Trace | |
| public static final String | |
| protected boolean | |
| private static final int | |
| private static final int | |
| protected BcelWeaver | |
| private ThreadLocal | |
| public static final String | WEAVING_ADAPTOR_VERBOSE
System property used to turn on verbose weaving messages |
| private int |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | WeavingAdaptor(WeavingClassLoader
instance of loader)ClassLoaderConstruct a WeavingAdaptor with a reference to a weaving class loader. |
| public | WeavingAdaptor(GeneratedClassHandler
GeneratedClassHandlerthe URLs from which to resolve classes classURLs, URL[] the aspects used to weave classes defined by this class loader aspectURLs)Construct a WeavingAdaptor with a reference to a |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | |
| private void | |
| public void | |
| private boolean | Returns: true if even valid to weave: either with an accept check or to munge it for @AspectJ aspectof support
|
| protected void | |
| protected boolean | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected boolean | |
| protected boolean | |
| private byte[] | Returns: byte[] the woven bytes for the classthe name of the class being woven name, byte[] the bytes that define the class bytes)Weave a set of bytes defining a class for only what is needed to turn @AspectJ aspect in a usefull form ie with aspectOf method - see #113587 |
| public String | |
| protected String | |
| private List | |
| protected List | |
| protected IMessageHandler | |
| public IMessageHolder | |
| private static boolean | |
| private byte[] | Returns: byte[] the woven bytes for the classthe name of the class being woven name, byte[] the bytes that define the class bytes)Weave a set of bytes defining a class. |
| protected boolean | |
| private void | |
| protected void | initializeCache(ClassLoader
classloader for this adapter, may be null loader, List<String> List of strings representing aspects managed by the adapter; these could be urls or classnames aspects, GeneratedClassHandler current class handler existingClassHandler, IMessageHandler current message handler myMessageHandler)If the cache is enabled, initialize it and swap out the existing classhandler for the caching one - |
| protected boolean | |
| private static List | |
| private void | |
| public void | |
| protected void | |
| protected boolean | |
| private boolean | Returns: true if @Aspectbytecode (from classloader), allow to NOT lookup stuff on disk again during resolve bytes)We allow @AJ aspect weaving so that we can add aspectOf() as part of the weaving (and not part of the source compilation) |
| private boolean | |
| protected boolean | |
| protected boolean | |
| public byte[] | Returns: the woven bytesthe name of the class name, byte[] the class bytes bytes)Weave a class using aspects previously supplied to the adaptor. |
| public byte[] | Returns: the woven bytesthe name of the class name, byte[] the class bytes bytes, boolean if true then this class *must* get woven (used for concrete aspects generated from XML) mustWeave)Weave a class using aspects previously supplied to the adaptor. |
| abortOnError | back to summary |
|---|---|
| private boolean abortOnError | |
| activeProtectionDomain | back to summary |
|---|---|
| protected ProtectionDomain activeProtectionDomain | |
| ASPECTJ_BASE_PACKAGE | back to summary |
|---|---|
| private static final String ASPECTJ_BASE_PACKAGE | |
| bcelWorld | back to summary |
|---|---|
| protected BcelWorld bcelWorld | |
| cache | back to summary |
|---|---|
| protected WeavedClassCache cache | |
| delegateForCurrentClass | back to summary |
|---|---|
| public BcelObjectType delegateForCurrentClass | |
| enabled | back to summary |
|---|---|
| private boolean enabled | |
| generatedClasses | back to summary |
|---|---|
| protected Map<String, IUnwovenClassFile> generatedClasses | |
| generatedClassHandler | back to summary |
|---|---|
| protected GeneratedClassHandler generatedClassHandler | |
| haveWarnedOnJavax | back to summary |
|---|---|
| private boolean haveWarnedOnJavax | |
| INITIALIZED | back to summary |
|---|---|
| private static final int INITIALIZED | |
| messageHandler | back to summary |
|---|---|
| private IMessageHandler messageHandler | |
| messageHolder | back to summary |
|---|---|
| private WeavingAdaptor. | |
| PACKAGE_INITIAL_CHARS | back to summary |
|---|---|
| private static final String PACKAGE_INITIAL_CHARS | |
| SHOW_WEAVE_INFO_PROPERTY | back to summary |
|---|---|
| public static final String SHOW_WEAVE_INFO_PROPERTY | |
| trace | back to summary |
|---|---|
| private static Trace trace | |
| TRACE_MESSAGES_PROPERTY | back to summary |
|---|---|
| public static final String TRACE_MESSAGES_PROPERTY | |
| verbose | back to summary |
|---|---|
| protected boolean verbose | |
| WEAVE_JAVA_PACKAGE | back to summary |
|---|---|
| private static final int WEAVE_JAVA_PACKAGE | |
| WEAVE_JAVAX_PACKAGE | back to summary |
|---|---|
| private static final int WEAVE_JAVAX_PACKAGE | |
| weaver | back to summary |
|---|---|
| protected BcelWeaver weaver | |
| weaverRunning | back to summary |
|---|---|
| private ThreadLocal<Boolean> weaverRunning | |
| WEAVING_ADAPTOR_VERBOSE | back to summary |
|---|---|
| public static final String WEAVING_ADAPTOR_VERBOSE System property used to turn on verbose weaving messages | |
| weavingSpecialTypes | back to summary |
|---|---|
| private int weavingSpecialTypes | |
| WeavingAdaptor | back to summary |
|---|---|
| protected WeavingAdaptor() | |
| WeavingAdaptor | back to summary |
|---|---|
| public WeavingAdaptor(WeavingClassLoader loader) Construct a WeavingAdaptor with a reference to a weaving class loader. The adaptor will automatically search the class loader hierarchy to resolve classes. The adaptor will also search the hierarchy for WeavingClassLoader instances to determine the set of aspects to be used for weaving.
| |
| WeavingAdaptor | back to summary |
|---|---|
| public WeavingAdaptor(GeneratedClassHandler handler, URL[] classURLs, URL[] aspectURLs) Construct a WeavingAdaptor with a reference to a
| |
| accept | back to summary |
|---|---|
| protected boolean accept(String name, byte[] bytes) | |
| addAspectLibrary | back to summary |
|---|---|
| private void addAspectLibrary(String aspectLibraryName) | |
| addURL | back to summary |
|---|---|
| public void addURL(URL url) Appends URL to path used by the WeavingAdptor to resolve classes
| |
| couldWeave | back to summary |
|---|---|
private boolean couldWeave(String name, byte[] bytes)
| |
| createMessageHandler | back to summary |
|---|---|
| protected void createMessageHandler() | |
| debug | back to summary |
|---|---|
| protected boolean debug(String message) | |
| disable | back to summary |
|---|---|
| protected void disable() | |
| dump | back to summary |
|---|---|
| protected void dump(String name, byte[] b, boolean before) Dump the given bytcode in _dump/... (dev mode)
| |
| enable | back to summary |
|---|---|
| protected void enable() | |
| ensureDelegateInitialized | back to summary |
|---|---|
| protected void ensureDelegateInitialized(String name, byte[] bytes) | |
| error | back to summary |
|---|---|
| protected boolean error(String message) | |
| error | back to summary |
|---|---|
| protected boolean error(String message, Throwable th) | |
| getAtAspectJAspectBytes | back to summary |
|---|---|
| private byte[] getAtAspectJAspectBytes(String name, byte[] bytes) throws IOException Weave a set of bytes defining a class for only what is needed to turn @AspectJ aspect in a usefull form ie with aspectOf method - see #113587
| |
| getContextId | back to summary |
|---|---|
| public String getContextId() Implements org. | |
| getDumpDir | back to summary |
|---|---|
protected String getDumpDir()
| |
| getFullAspectPath | back to summary |
|---|---|
| private List | |
| getFullClassPath | back to summary |
|---|---|
| protected List | |
| getMessageHandler | back to summary |
|---|---|
| protected IMessageHandler getMessageHandler() | |
| getMessageHolder | back to summary |
|---|---|
| public IMessageHolder getMessageHolder() | |
| getVerbose | back to summary |
|---|---|
| private static boolean getVerbose() | |
| getWovenBytes | back to summary |
|---|---|
| private byte[] getWovenBytes(String name, byte[] bytes) throws IOException Weave a set of bytes defining a class.
| |
| info | back to summary |
|---|---|
| protected boolean info(String message) | |
| init | back to summary |
|---|---|
| private void init(ClassLoader loader, List<String> classPath, List<String> aspectPath) Initialize the WeavingAdapter
| |
| initializeCache | back to summary |
|---|---|
| protected void initializeCache(ClassLoader loader, List<String> aspects, GeneratedClassHandler existingClassHandler, IMessageHandler myMessageHandler) If the cache is enabled, initialize it and swap out the existing classhandler for the caching one -
| |
| isEnabled | back to summary |
|---|---|
| protected boolean isEnabled() | |
| makeClasspath | back to summary |
|---|---|
| private static List | |
| registerAspectLibraries | back to summary |
|---|---|
| private void registerAspectLibraries(List<String> aspectPath) | |
| setActiveProtectionDomain | back to summary |
|---|---|
| public void setActiveProtectionDomain(ProtectionDomain protectionDomain) | |
| setMessageHandler | back to summary |
|---|---|
| protected void setMessageHandler(IMessageHandler mh) | |
| shouldDump | back to summary |
|---|---|
| protected boolean shouldDump(String name, boolean before) | |
| shouldWeaveAnnotationStyleAspect | back to summary |
|---|---|
| private boolean shouldWeaveAnnotationStyleAspect(String name, byte[] bytes) We allow @AJ aspect weaving so that we can add aspectOf() as part of the weaving (and not part of the source compilation)
| |
| shouldWeaveName | back to summary |
|---|---|
| private boolean shouldWeaveName(String name) | |
| warn | back to summary |
|---|---|
| protected boolean warn(String message) | |
| warn | back to summary |
|---|---|
| protected boolean warn(String message, Throwable th) | |
| weaveClass | back to summary |
|---|---|
| public byte[] weaveClass(String name, byte[] bytes) throws IOException Weave a class using aspects previously supplied to the adaptor.
| |
| weaveClass | back to summary |
|---|---|
| public byte[] weaveClass(String name, byte[] bytes, boolean mustWeave) throws IOException Weave a class using aspects previously supplied to the adaptor.
| |
| Modifier and Type | Field and Description |
|---|---|
| private IMessageHandler | |
| private List | |
| protected boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | dontIgnore(IMessage.
Overrides org. Implements org. |
| public void | |
| public List | |
| public boolean | handleMessage(IMessage
the IMessage to handle - never null message)Overrides org. Implements org. |
| public void | ignore(IMessage.
Overrides org. Implements org. |
| public boolean | isIgnoring(IMessage.
Overrides org. Implements org. |
| protected String | |
| public void | |
| private void |
| delegate | back to summary |
|---|---|
| private IMessageHandler delegate | |
| savedMessages | back to summary |
|---|---|
| private List<IMessage> savedMessages | |
| traceMessages | back to summary |
|---|---|
| protected boolean traceMessages | |
| WeavingAdaptorMessageHolder | back to summary |
|---|---|
| public WeavingAdaptorMessageHolder(PrintWriter writer) | |
| dontIgnore | back to summary |
|---|---|
| public void dontIgnore(IMessage. Overrides org. Implements org. Doc from org. Remove a message kind from the list of those ignored from now on.
| |
| flushMessages | back to summary |
|---|---|
| public void flushMessages() | |
| getUnmodifiableListView | back to summary |
|---|---|
| public List Overrides org. Implements org.
| |
| handleMessage | back to summary |
|---|---|
| public boolean handleMessage(IMessage message) throws AbortException Overrides org. Implements org. Doc from org. This implementation accumulates message. If an interceptor is installed and returns true (message handled), then processing halts and the message is not accumulated.
| |
| ignore | back to summary |
|---|---|
| public void ignore(IMessage. Overrides org. Implements org. Doc from org. Set a message kind to be ignored from now on
| |
| isIgnoring | back to summary |
|---|---|
| public boolean isIgnoring(IMessage. Overrides org. Implements org. Doc from org. Signal clients whether this will ignore messages of a given type. Clients may use this to avoid constructing or sending certain messages.
| |
| render | back to summary |
|---|---|
| protected String render(IMessage message) | |
| setDelegate | back to summary |
|---|---|
| public void setDelegate(IMessageHandler messageHandler) | |
| traceMessage | back to summary |
|---|---|
| private void traceMessage(IMessage message) | |
| Modifier and Type | Field and Description |
|---|---|
| private final IMessage. | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | dontIgnore(IMessage.
Overrides org. Implements org. |
| public boolean | handleMessage(IMessage
the IMessage to handle - never null message)Overrides org. Implements org. |
| public void | ignore(IMessage.
Overrides org. Implements org. |
| public boolean | isIgnoring(IMessage.
Overrides org. Implements org. |
| protected String |
| failKind | back to summary |
|---|---|
| private final IMessage. | |
| ignoring | back to summary |
|---|---|
| private final Set<IMessage. | |
| WeavingAdaptorMessageWriter | back to summary |
|---|---|
| public WeavingAdaptorMessageWriter(PrintWriter writer) | |
| dontIgnore | back to summary |
|---|---|
| public void dontIgnore(IMessage. Overrides org. Implements org. Remove a message kind from the list of those ignored from now on.
| |
| handleMessage | back to summary |
|---|---|
| public boolean handleMessage(IMessage message) throws AbortException Overrides org. Implements org. Doc from org. Handle message by printing and (if abortOnFailure) throwing an AbortException if the messages is a failure or an abort (but not for errors).
| |
| ignore | back to summary |
|---|---|
| public void ignore(IMessage. Overrides org. Implements org. Set a message kind to be ignored from now on
| |
| isIgnoring | back to summary |
|---|---|
| public boolean isIgnoring(IMessage. Overrides org. Implements org. Doc from org. Signal clients whether this will ignore messages of a given type. Clients may use this to avoid constructing or sending certain messages.
| |
| render | back to summary |
|---|---|
| protected String render(IMessage message) Overrides org.
| |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final UnwovenClassFile | |
| private final List | |
| private IUnwovenClassFile |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | |
| public Iterator | getClassFileIterator()
Implements org. |
| public IWeaveRequestor | getRequestor()
Implements org. |
| public boolean | |
| public void |
| isApplyAtAspectJMungersOnly | back to summary |
|---|---|
| private boolean isApplyAtAspectJMungersOnly | |
| unwovenClass | back to summary |
|---|---|
| private final UnwovenClassFile unwovenClass | |
| unwovenClasses | back to summary |
|---|---|
| private final List<UnwovenClassFile> unwovenClasses | |
| wovenClass | back to summary |
|---|---|
| private IUnwovenClassFile wovenClass | |
| WeavingClassFileProvider | back to summary |
|---|---|
| public WeavingClassFileProvider(String name, byte[] bytes) | |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes() | |
| getClassFileIterator | back to summary |
|---|---|
| public Iterator Implements org. Doc from org. Answer an iterator that can be used to iterate over a set of UnwovenClassFiles to be woven. During a weave, this method may be called multiple times.
| |
| getRequestor | back to summary |
|---|---|
| public IWeaveRequestor getRequestor() Implements org. Doc from org. The client to which the woven results should be returned. | |
| isApplyAtAspectJMungersOnly | back to summary |
|---|---|
| public boolean isApplyAtAspectJMungersOnly() Implements org.
| |
| setApplyAtAspectJMungersOnly | back to summary |
|---|---|
| public void setApplyAtAspectJMungersOnly() | |