diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-04-10 12:32:04 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-04-10 12:33:08 +0700 |
commit | f3ff0752b8ee68583fb5a90687ddb5943c2df25b (patch) | |
tree | 60212ecef510244380606c45e52af34e08a66fe1 /loadtime/src/main/java | |
parent | 2b0b1a98959bd0d569f1d04bd3b25dac8ef0bb7a (diff) | |
download | aspectj-f3ff0752b8ee68583fb5a90687ddb5943c2df25b.tar.gz aspectj-f3ff0752b8ee68583fb5a90687ddb5943c2df25b.zip |
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 <Alexander@Kriegisch.name>
Diffstat (limited to 'loadtime/src/main/java')
-rw-r--r-- | loadtime/src/main/java/org/aspectj/weaver/loadtime/JRockitAgent.java | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/loadtime/src/main/java/org/aspectj/weaver/loadtime/JRockitAgent.java b/loadtime/src/main/java/org/aspectj/weaver/loadtime/JRockitAgent.java deleted file mode 100644 index 56ad0e958..000000000 --- a/loadtime/src/main/java/org/aspectj/weaver/loadtime/JRockitAgent.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Matthew Webster - initial implementation - *******************************************************************************/ -package org.aspectj.weaver.loadtime; - -import java.util.Stack; - -import com.bea.jvm.ClassLibrary; -import com.bea.jvm.JVMFactory; - -/** - * BEA JRocket JMAPI agent. - * - * Use "-Xmanagement:class=org.aspectj.weaver.loadtime.JRockitAgent" - */ -public class JRockitAgent implements com.bea.jvm.ClassPreProcessor { - - private ClassPreProcessor preProcessor; - - /* - * This is used to implement the recursion protection offered by JVMTI but not by JRockit JMAPI. I we are called to preProcess a - * class while already preProcessing another we will return immediately - */ - private static ThreadLocalStack stack = new ThreadLocalStack(); - - public JRockitAgent() { - this.preProcessor = new Aj(); - - ClassLibrary cl = JVMFactory.getJVM().getClassLibrary(); - cl.setClassPreProcessor(this); - } - - public byte[] preProcess(ClassLoader loader, String className, byte[] bytes) { - byte[] newBytes = bytes; - - if (stack.empty()) { - stack.push(className); - newBytes = preProcessor.preProcess(className, bytes, loader, null); - stack.pop(); - } - - return newBytes; - } - - private static class ThreadLocalStack extends ThreadLocal { - - public boolean empty() { - Stack stack = (Stack) get(); - return stack.empty(); - } - - public Object peek() { - Object obj = null; - Stack stack = (Stack) get(); - if (!stack.empty()) - obj = stack.peek(); - return obj; - } - - public void push(Object obj) { - Stack stack = (Stack) get(); - if (!stack.empty() && obj == stack.peek()) - throw new RuntimeException(obj.toString()); - stack.push(obj); - } - - public Object pop() { - Stack stack = (Stack) get(); - return stack.pop(); - } - - protected Object initialValue() { - return new Stack(); - } - } - -} |