Skip to content

Commit 4e631fa

Browse files
committed
8298966: Deprecate JMX Subject Delegation and the method JMXConnector.getMBeanServerConnection(Subject) for removal.
Reviewed-by: mchung, dfuchs
1 parent 10f1674 commit 4e631fa

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2023, 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
@@ -390,6 +390,7 @@ public synchronized MBeanServerConnection getMBeanServerConnection()
390390
return getMBeanServerConnection(null);
391391
}
392392

393+
@SuppressWarnings("removal")
393394
public synchronized MBeanServerConnection
394395
getMBeanServerConnection(Subject delegationSubject)
395396
throws IOException {

src/java.management/share/classes/javax/management/remote/JMXConnector.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2023, 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
@@ -168,7 +168,13 @@ public MBeanServerConnection getMBeanServerConnection()
168168
* cannot be created, for instance because the connection to the remote
169169
* MBean server has not yet been established (with the {@link #connect(Map)
170170
* connect} method), or it has been closed, or it has broken.
171+
*
172+
* @deprecated This method supported the legacy Subject Delegation feature,
173+
* and is only useful in conjunction with other APIs which are deprecated and
174+
* subject to removal in a future release. Consequently, this method is also
175+
* deprecated and subject to removal. There is no replacement.
171176
*/
177+
@Deprecated(since="21", forRemoval=true)
172178
public MBeanServerConnection getMBeanServerConnection(
173179
Subject delegationSubject)
174180
throws IOException;

0 commit comments

Comments
 (0)