8151099: java.lang.management.ManagementFactory.getPlatformMXBeans() should work even if jdk.management is not present
Removed dependency of java.management over jdk.management. Reviewed-by: mchung, dfuchs, dholmes
This commit is contained in:
parent
5a51418eb9
commit
efe353282a
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -173,6 +173,20 @@ void Management::get_optional_support(jmmOptionalSupport* support) {
|
|||||||
|
|
||||||
Klass* Management::load_and_initialize_klass(Symbol* sh, TRAPS) {
|
Klass* Management::load_and_initialize_klass(Symbol* sh, TRAPS) {
|
||||||
Klass* k = SystemDictionary::resolve_or_fail(sh, true, CHECK_NULL);
|
Klass* k = SystemDictionary::resolve_or_fail(sh, true, CHECK_NULL);
|
||||||
|
Klass* ik = initialize_klass(k, CHECK_NULL);
|
||||||
|
return ik;
|
||||||
|
}
|
||||||
|
|
||||||
|
Klass* Management::load_and_initialize_klass_or_null(Symbol* sh, TRAPS) {
|
||||||
|
Klass* k = SystemDictionary::resolve_or_null(sh, CHECK_NULL);
|
||||||
|
if (k == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
Klass* ik = initialize_klass(k, CHECK_NULL);
|
||||||
|
return ik;
|
||||||
|
}
|
||||||
|
|
||||||
|
Klass* Management::initialize_klass(Klass* k, TRAPS) {
|
||||||
instanceKlassHandle ik (THREAD, k);
|
instanceKlassHandle ik (THREAD, k);
|
||||||
if (ik->should_be_initialized()) {
|
if (ik->should_be_initialized()) {
|
||||||
ik->initialize(CHECK_NULL);
|
ik->initialize(CHECK_NULL);
|
||||||
@ -255,7 +269,8 @@ Klass* Management::sun_management_ManagementFactoryHelper_klass(TRAPS) {
|
|||||||
|
|
||||||
Klass* Management::com_sun_management_internal_GarbageCollectorExtImpl_klass(TRAPS) {
|
Klass* Management::com_sun_management_internal_GarbageCollectorExtImpl_klass(TRAPS) {
|
||||||
if (_garbageCollectorExtImpl_klass == NULL) {
|
if (_garbageCollectorExtImpl_klass == NULL) {
|
||||||
_garbageCollectorExtImpl_klass = load_and_initialize_klass(vmSymbols::com_sun_management_internal_GarbageCollectorExtImpl(), CHECK_NULL);
|
_garbageCollectorExtImpl_klass =
|
||||||
|
load_and_initialize_klass_or_null(vmSymbols::com_sun_management_internal_GarbageCollectorExtImpl(), CHECK_NULL);
|
||||||
}
|
}
|
||||||
return _garbageCollectorExtImpl_klass;
|
return _garbageCollectorExtImpl_klass;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -53,6 +53,8 @@ private:
|
|||||||
static Klass* _sensor_klass;
|
static Klass* _sensor_klass;
|
||||||
static Klass* _threadInfo_klass;
|
static Klass* _threadInfo_klass;
|
||||||
static Klass* load_and_initialize_klass(Symbol* sh, TRAPS);
|
static Klass* load_and_initialize_klass(Symbol* sh, TRAPS);
|
||||||
|
static Klass* load_and_initialize_klass_or_null(Symbol* sh, TRAPS);
|
||||||
|
static Klass* initialize_klass(Klass* k, TRAPS);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void init();
|
static void init();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user