Skip to content

Commit 17666fb

Browse files
committed
8297794: Deprecate JMX Management Applets for Removal
Reviewed-by: dfuchs, mullan, rriggs, alanb
1 parent 619b68c commit 17666fb

19 files changed

+58
-19
lines changed

src/java.management/share/classes/javax/management/loading/MLet.java

+6
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,14 @@
162162
* <p><STRONG>Note - </STRONG> The <CODE>MLet</CODE> class loader uses the {@link javax.management.MBeanServerFactory#getClassLoaderRepository(javax.management.MBeanServer)}
163163
* to load classes that could not be found in the loaded jar files.
164164
*
165+
* @deprecated This API is part of Management Applets (m-lets), which is a legacy feature that allows loading
166+
* of remote MBeans. This feature is not usable without a Security Manager, which is deprecated and subject to
167+
* removal in a future release. Consequently, this API is also deprecated and subject to removal. There is no replacement.
168+
*
165169
* @since 1.5
166170
*/
171+
@Deprecated(since="20", forRemoval=true)
172+
@SuppressWarnings("removal")
167173
public class MLet extends java.net.URLClassLoader
168174
implements MLetMBean, MBeanRegistration, Externalizable {
169175

src/java.management/share/classes/javax/management/loading/MLetContent.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@
3939
* It can be consulted by a subclass of {@link MLet} that overrides
4040
* the {@link MLet#check MLet.check} method.
4141
*
42+
* @deprecated This API is part of Management Applets (m-lets), which is a legacy feature that allows loading
43+
* of remote MBeans. This feature is not usable without a Security Manager, which is deprecated and subject to
44+
* removal in a future release. Consequently, this API is also deprecated and subject to removal. There is no replacement.
45+
*
4246
* @since 1.6
4347
*/
48+
@Deprecated(since="20", forRemoval=true)
4449
public class MLetContent {
4550

46-
4751
/**
4852
* A map of the attributes of the <CODE>MLET</CODE> tag
4953
* and their values.

src/java.management/share/classes/javax/management/loading/MLetMBean.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -39,11 +39,15 @@
3939
* Exposes the remote management interface of the MLet
4040
* MBean.
4141
*
42+
* @deprecated This API is part of Management Applets (m-lets), which is a legacy feature that allows loading
43+
* of remote MBeans. This feature is not usable without a Security Manager, which is deprecated and subject to
44+
* removal in a future release. Consequently, this API is also deprecated and subject to removal. There is no replacement.
45+
*
4246
* @since 1.5
4347
*/
48+
@Deprecated(since="20", forRemoval=true)
4449
public interface MLetMBean {
4550

46-
4751
/**
4852
* Loads a text file containing MLET tags that define the MBeans
4953
* to be added to the MBean server. The location of the text file is

src/java.management/share/classes/javax/management/loading/MLetObjectInputStream.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,13 +38,16 @@
3838
*
3939
* @since 1.5
4040
*/
41+
@Deprecated(since="20", forRemoval=true)
4142
class MLetObjectInputStream extends ObjectInputStream {
4243

44+
@SuppressWarnings("removal")
4345
private MLet loader;
4446

4547
/**
4648
* Loader must be non-null;
4749
*/
50+
@SuppressWarnings("removal")
4851
public MLetObjectInputStream(InputStream in, MLet loader)
4952
throws IOException, StreamCorruptedException {
5053

src/java.management/share/classes/javax/management/loading/MLetParser.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
*
4848
* @since 1.5
4949
*/
50+
@Deprecated(since="20", forRemoval=true)
5051
class MLetParser {
5152

5253
/*
@@ -153,6 +154,7 @@ public Map<String,String> scanTag(Reader in) throws IOException {
153154
/**
154155
* Scan an html file for {@literal <mlet>} tags.
155156
*/
157+
@SuppressWarnings("removal")
156158
public List<MLetContent> parse(URL url) throws IOException {
157159
// Warning Messages
158160
String requiresTypeWarning = "<arg type=... value=...> tag requires type parameter.";
@@ -249,7 +251,7 @@ public List<MLetContent> parse(URL url) throws IOException {
249251
/**
250252
* Parse the document pointed by the URL urlname
251253
*/
252-
@SuppressWarnings("deprecation")
254+
@SuppressWarnings("removal")
253255
public List<MLetContent> parseURL(String urlname) throws IOException {
254256
// Parse the document
255257
//

src/java.management/share/classes/javax/management/loading/PrivateMLet.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,14 @@
3636
* ClassLoaderRepository}. This is true because this class implements
3737
* the interface {@link PrivateClassLoader}.
3838
*
39+
* @deprecated This API is part of Management Applets (m-lets), which is a legacy feature that allows loading
40+
* of remote MBeans. This feature is not usable without a Security Manager, which is deprecated and subject to
41+
* removal in a future release. Consequently, this API is also deprecated and subject to removal. There is no replacement.
42+
*
3943
* @since 1.5
4044
*/
41-
@SuppressWarnings("serial") // Externalizable class w/o no-arg c'tor
45+
@Deprecated(since="20", forRemoval=true)
46+
@SuppressWarnings({"serial", "removal"}) // Externalizable class w/o no-arg c'tor
4247
public class PrivateMLet extends MLet implements PrivateClassLoader {
4348
private static final long serialVersionUID = 2503458973393711979L;
4449

test/jdk/javax/management/Introspector/ClassLeakTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,7 @@ public static void main(String[] args) throws Exception {
5656
urls[i] = Paths.get(cpaths[i]).toUri().toURL();
5757
}
5858

59+
@SuppressWarnings("removal")
5960
PrivateMLet mlet = new PrivateMLet(urls, null, false);
6061
Class<?> shadowClass = mlet.loadClass(TestMBean.class.getName());
6162
if (shadowClass == TestMBean.class) {

test/jdk/javax/management/MBeanServer/PostExceptionTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -432,6 +432,7 @@ public ObjectName registerMLet(MBeanServer server) throws Exception {
432432
if (server.isRegistered(name)) {
433433
return name;
434434
}
435+
@SuppressWarnings("removal")
435436
final MLet mlet = new MLet(new URL[0],
436437
ClassLoader.getSystemClassLoader());
437438
return server.registerMBean(mlet, name).getObjectName();

test/jdk/javax/management/loading/DocumentRootTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,7 @@
3838
import java.util.HashMap;
3939
import javax.management.loading.MLetContent;
4040

41+
@SuppressWarnings("removal")
4142
public class DocumentRootTest {
4243
public static int test(URL documentBase, URL codeBase) {
4344
int error = 0;

test/jdk/javax/management/loading/GetMBeansFromURLTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
4040
import javax.management.ServiceNotFoundException;
4141
import javax.management.loading.MLet;
4242

43+
@SuppressWarnings("removal")
4344
public class GetMBeansFromURLTest {
4445

4546
public static void main(String[] args) throws Exception {

test/jdk/javax/management/loading/MLetCLR/MLetCommand.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
3939
import javax.management.ObjectName;
4040
import java.io.File;
4141

42+
@SuppressWarnings("removal")
4243
public class MLetCommand {
4344

4445
public static void main(String[] args) throws Exception {

test/jdk/javax/management/loading/MLetContentTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,7 @@
3737

3838
import javax.management.loading.*;
3939

40+
@SuppressWarnings("removal")
4041
public class MLetContentTest {
4142
public static void main(String[] args) throws Exception {
4243
System.out.println(">>> General test for the public class MLetContent.");

test/jdk/javax/management/loading/MLetInternalsTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
3939
* @modules java.management/javax.management.loading:open
4040
* @run testng MLetInternalsTest
4141
*/
42+
@SuppressWarnings("removal")
4243
public class MLetInternalsTest {
4344
private final static String CONSTRUCT_PARAMETER = "constructParameter";
4445

test/jdk/javax/management/loading/MletParserLocaleTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import javax.management.ObjectName;
4040
import javax.management.loading.MLet;
4141

42+
@SuppressWarnings("removal")
4243
public class MletParserLocaleTest {
4344

4445
public static void main(String[] args) throws Exception {

test/jdk/javax/management/loading/ParserInfiniteLoopTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
4545
import javax.management.ServiceNotFoundException;
4646
import javax.management.loading.MLet;
4747

48+
@SuppressWarnings("removal")
4849
public class ParserInfiniteLoopTest {
4950

5051
public static void main(String[] args) throws Exception {

test/jdk/javax/management/mxbean/MXBeanLoadingTest1.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -81,6 +81,7 @@ public void run(Map<String, Object> args) {
8181
+ ".class", "");
8282

8383
URL[] urls = new URL[]{new URL(clsLoadPath)};
84+
@SuppressWarnings("removal")
8485
PrivateMLet mlet = new PrivateMLet(urls, null, false);
8586
Class<?> shadowClass = mlet.loadClass(TestMXBean.class.getName());
8687

@@ -266,6 +267,7 @@ public void run(Map<String, Object> args) {
266267
mbs.unregisterMBean(testName);
267268
mbs.unregisterMBean(mletName);
268269

270+
@SuppressWarnings("removal")
269271
WeakReference<PrivateMLet> mletRef =
270272
new WeakReference<PrivateMLet>(mlet);
271273
mlet = null;

test/jdk/javax/management/relation/NonArrayListTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,8 @@
3838
import javax.management.loading.MLet;
3939

4040
public class NonArrayListTest {
41+
42+
@SuppressWarnings("removal") // use of MLet
4143
public static void main(String[] args) throws Exception {
4244
MBeanServer mbs = MBeanServerFactory.createMBeanServer();
4345
RelationService rs = new RelationService(true);

test/jdk/javax/management/remote/mandatory/loading/TargetMBeanTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -101,6 +101,7 @@ public static void main(String[] args) throws Exception {
101101

102102
URLClassLoader jrcl = (URLClassLoader) jmxRemoteClassLoader;
103103
URL[] urls = jrcl.getURLs();
104+
@SuppressWarnings("removal")
104105
PrivateMLet mlet = new PrivateMLet(urls, null, false);
105106
Class shadowClass = mlet.loadClass(JMXServiceURL.class.getName());
106107
if (shadowClass == JMXServiceURL.class) {

test/jdk/javax/management/remote/mandatory/notif/NotificationBufferTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -80,6 +80,7 @@ public static void main(String[] args) {
8080
}
8181
}
8282

83+
@SuppressWarnings("removal") // use of MLet
8384
private static boolean test() throws Exception {
8485
MBeanServer mbs = MBeanServerFactory.createMBeanServer();
8586

0 commit comments

Comments
 (0)