From f3ff0752b8ee68583fb5a90687ddb5943c2df25b Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sat, 10 Apr 2021 12:32:04 +0700 Subject: Remove JRockit LTW support, particularly JRockitAgent In two places, the documentation now contains this text: "Since AspectJ 1.9.7, the obsolete Oracle/BEA JRockit agent is no longer part of AspectJ. JRockit JDK never supported Java versions higher than 1.6. Several JRockit JVM features are now part of HotSpot and tools like Mission Control available for OpenJDK and Oracle JDK." The decision to drop JRockit support was made during a discussion between Alexander Kriegisch and Andy Clement: Andy Clement wrote on 26 Mar 2021: > Yes I think so. > > > Alexander Kriegisch wrote on 26 Mar 2021: > >> https://en.wikipedia.org/wiki/JRockit >> >> Can we get rid of that? AspectJ requires Java 8, JRockit never >> supported more than Java 6. Signed-off-by: Alexander Kriegisch --- docs/devGuideDB/ltw.xml | 138 ++++++++++++++++++++++++------------------------ 1 file changed, 70 insertions(+), 68 deletions(-) (limited to 'docs/devGuideDB/ltw.xml') diff --git a/docs/devGuideDB/ltw.xml b/docs/devGuideDB/ltw.xml index 3d8723662..bc5aac769 100644 --- a/docs/devGuideDB/ltw.xml +++ b/docs/devGuideDB/ltw.xml @@ -1,23 +1,23 @@ Load-Time Weaving - + Introduction - + The AspectJ weaver takes class files as input and produces class files as output. The weaving process itself can take place at one of three different times: compile-time, post-compile time, and load-time. The class files produced by the weaving process (and hence the run-time behaviour of an application) are the same regardless of the approach chosen. - + Compile-time weaving is the simplest approach. When you have the source code for an application, ajc will compile from source and produce woven class files as output. The invocation of the weaver is integral to the ajc compilation process. The - aspects themselves may be in source or binary form. + aspects themselves may be in source or binary form. If the aspects are required for the affected classes to compile, then you must weave at compile-time. Aspects are required, e.g., when they - add members to a class and other classes being compiled reference the + add members to a class and other classes being compiled reference the added members. Post-compile weaving (also sometimes called binary weaving) is used to weave @@ -29,32 +29,32 @@ one or more "weaving class loaders", either provided explicitly by the run-time environment or enabled through a "weaving agent" are required. - + You may also hear the term "run-time weaving". We define this as the weaving of classes that have already been defined to the JVM (without reloading those classes). AspectJ 5 does not provide explicit support for run-time weaving although simple coding patterns can support dynamically enabling and disabling advice in aspects. - + Weaving class files more than once - + As of AspectJ 5 aspects (code style or annotation style) and woven classes are - reweavable by default. If you are developing AspectJ applications that are to be used + reweavable by default. If you are developing AspectJ applications that are to be used in a load-time weaving environment with an older version of the compiler you need to specify the -Xreweavable compiler option when building them. This causes AspectJ to save additional state in the class files that is used to support subsequent reweaving. - + Load-time Weaving Requirements - + All load-time weaving is done in the context of a class loader, and hence the set of aspects used for weaving and the types that can be woven are affected by the class loader delegation model. This ensures that LTW complies with the Java 2 security model. The following rules govern the interaction of load-time weaving with class loading: - + All aspects to be used for weaving must be defined to the weaver before any types to be woven are loaded. This avoids types being "missed" by aspects added @@ -66,19 +66,19 @@ may be extended. A class loader may only weave classes that it defines. It may not weave - classes loaded by a delegate or parent class loader. + classes loaded by a delegate or parent class loader. - + - + Configuration New in AspectJ 5 are a number of mechanisms to make load-time weaving - easy to use. The load-time weaving mechanism is chosen through JVM startup options. - Configuration files determine the set of aspects to be used for weaving and which - types will be woven. Additional diagnostic options allow the user to debug the configuration and + easy to use. The load-time weaving mechanism is chosen through JVM startup options. + Configuration files determine the set of aspects to be used for weaving and which + types will be woven. Additional diagnostic options allow the user to debug the configuration and weaving process. - + Enabling Load-time Weaving AspectJ 5 supports several ways of enabling load-time weaving for @@ -88,15 +88,16 @@ Agents - AspectJ 5 ships with a number of load-time weaving agents that - enable load-time weaving. These agents and their configuration - are execution environment dependent. Configuration for the supported environments is discussed + AspectJ 5 ships with a load-time weaving agent that + enables load-time weaving. This agent and its configuration + is execution environment dependent. Configuration for the supported environments is discussed later in this chapter. Using Java 5 JVMTI you can specify the -javaagent:pathto/aspectjweaver.jar option to the JVM. - Using BEA JRockit and Java 1.3/1.4, the very same behavior can be obtained using BEA JRockit JMAPI features with - the -Xmanagement:class=org.aspectj.weaver.loadtime.JRockitAgent + Since AspectJ 1.9.7, the obsolete Oracle/BEA JRockit agent is no longer part of AspectJ. + JRockit JDK never supported Java versions higher than 1.6. Several JRockit JVM features are + now part of HotSpot and tools like Mission Control available for OpenJDK and Oracle JDK. @@ -104,12 +105,12 @@ Command-line wrapper scripts aj The aj command runs Java programs in Java 1.4 or - later by setting up WeavingURLClassLoader as the - system class loader. + later by setting up WeavingURLClassLoader as the + system class loader. For more information, see . The aj5 command runs Java programs in Java 5 - by using the -javaagent:pathto/aspectjweaver.jar option + by using the -javaagent:pathto/aspectjweaver.jar option described above. For more information, see . @@ -132,10 +133,10 @@ - + Configuring Load-time Weaving with aop.xml files - + The weaver is configured using one or more META-INF/aop.xml files located on the class loader search path. Each file may declare a list of aspects to be used for weaving, type patterns describing which types @@ -187,16 +188,16 @@