8173608: Separate JDK management agent from java.management module

Reviewed-by: dfuchs, dholmes, erikj
This commit is contained in:
Mandy Chung 2017-01-31 20:06:42 -08:00
parent b659f6d8f4
commit 3c835ae983
4 changed files with 15 additions and 15 deletions

View File

@ -590,11 +590,11 @@
template(java_lang_management_ThreadState, "java/lang/management/ThreadState") \
template(java_lang_management_MemoryUsage, "java/lang/management/MemoryUsage") \
template(java_lang_management_ThreadInfo, "java/lang/management/ThreadInfo") \
template(jdk_internal_agent_Agent, "jdk/internal/agent/Agent") \
template(sun_management_Sensor, "sun/management/Sensor") \
template(sun_management_Agent, "sun/management/Agent") \
template(sun_management_ManagementFactoryHelper, "sun/management/ManagementFactoryHelper") \
template(com_sun_management_internal_DiagnosticCommandImpl, "com/sun/management/internal/DiagnosticCommandImpl") \
template(com_sun_management_internal_GarbageCollectorExtImpl,"com/sun/management/internal/GarbageCollectorExtImpl") \
template(sun_management_ManagementFactoryHelper, "sun/management/ManagementFactoryHelper") \
template(getDiagnosticCommandMBean_name, "getDiagnosticCommandMBean") \
template(getDiagnosticCommandMBean_signature, "()Lcom/sun/management/DiagnosticCommandMBean;") \
template(getGcInfoBuilder_name, "getGcInfoBuilder") \

View File

@ -3195,8 +3195,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
if (FLAG_SET_CMDLINE(bool, ManagementServer, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// management agent in module java.management
if (!create_numbered_property("jdk.module.addmods", "java.management", addmods_count++)) {
// management agent in module jdk.management.agent
if (!create_numbered_property("jdk.module.addmods", "jdk.management.agent", addmods_count++)) {
return JNI_ENOMEM;
}
#else

View File

@ -748,13 +748,13 @@ void JMXStartRemoteDCmd::execute(DCmdSource source, TRAPS) {
ResourceMark rm(THREAD);
HandleMark hm(THREAD);
// Load and initialize the sun.management.Agent class
// Load and initialize the jdk.internal.agent.Agent class
// invoke startRemoteManagementAgent(string) method to start
// the remote management server.
// throw java.lang.NoSuchMethodError if the method doesn't exist
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::jdk_internal_agent_Agent(), loader, Handle(), true, CHECK);
instanceKlassHandle ik (THREAD, k);
JavaValue result(T_VOID);
@ -821,13 +821,13 @@ void JMXStartLocalDCmd::execute(DCmdSource source, TRAPS) {
ResourceMark rm(THREAD);
HandleMark hm(THREAD);
// Load and initialize the sun.management.Agent class
// Load and initialize the jdk.internal.agent.Agent class
// invoke startLocalManagementAgent(void) method to start
// the local management server
// throw java.lang.NoSuchMethodError if method doesn't exist
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::jdk_internal_agent_Agent(), loader, Handle(), true, CHECK);
instanceKlassHandle ik (THREAD, k);
JavaValue result(T_VOID);
@ -838,13 +838,13 @@ void JMXStopRemoteDCmd::execute(DCmdSource source, TRAPS) {
ResourceMark rm(THREAD);
HandleMark hm(THREAD);
// Load and initialize the sun.management.Agent class
// Load and initialize the jdk.internal.agent.Agent class
// invoke stopRemoteManagementAgent method to stop the
// management server
// throw java.lang.NoSuchMethodError if method doesn't exist
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::jdk_internal_agent_Agent(), loader, Handle(), true, CHECK);
instanceKlassHandle ik (THREAD, k);
JavaValue result(T_VOID);
@ -860,12 +860,12 @@ void JMXStatusDCmd::execute(DCmdSource source, TRAPS) {
ResourceMark rm(THREAD);
HandleMark hm(THREAD);
// Load and initialize the sun.management.Agent class
// Load and initialize the jdk.internal.agent.Agent class
// invoke getManagementAgentStatus() method to generate the status info
// throw java.lang.NoSuchMethodError if method doesn't exist
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::jdk_internal_agent_Agent(), loader, Handle(), true, CHECK);
instanceKlassHandle ik (THREAD, k);
JavaValue result(T_OBJECT);

View File

@ -145,16 +145,16 @@ void Management::initialize(TRAPS) {
ResourceMark rm(THREAD);
HandleMark hm(THREAD);
// Load and initialize the sun.management.Agent class
// Load and initialize the jdk.internal.agent.Agent class
// invoke startAgent method to start the management server
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
Klass* k = SystemDictionary::resolve_or_null(vmSymbols::sun_management_Agent(),
Klass* k = SystemDictionary::resolve_or_null(vmSymbols::jdk_internal_agent_Agent(),
loader,
Handle(),
THREAD);
if (k == NULL) {
vm_exit_during_initialization("Management agent initialization failure: "
"class sun.management.Agent not found.");
"class jdk.internal.agent.Agent not found.");
}
instanceKlassHandle ik (THREAD, k);