27 #include "classfile/classLoader.hpp"
28 #include "classfile/systemDictionary.hpp"
29 #include "compiler/compileBroker.hpp"
30 #include "memory/allocation.inline.hpp"
31 #include "memory/iterator.hpp"
32 #include "memory/oopFactory.hpp"
33 #include "memory/resourceArea.hpp"
34 #include "memory/universe.hpp"
35 #include "oops/klass.hpp"
36 #include "oops/objArrayKlass.hpp"
37 #include "oops/objArrayOop.inline.hpp"
38 #include "oops/oop.inline.hpp"
39 #include "oops/typeArrayOop.inline.hpp"
40 #include "runtime/arguments.hpp"
41 #include "runtime/flags/jvmFlag.hpp"
42 #include "runtime/globals.hpp"
43 #include "runtime/handles.inline.hpp"
44 #include "runtime/interfaceSupport.inline.hpp"
45 #include "runtime/javaCalls.hpp"
46 #include "runtime/jniHandles.inline.hpp"
47 #include "runtime/os.hpp"
48 #include "runtime/serviceThread.hpp"
49 #include "runtime/thread.inline.hpp"
50 #include "runtime/threadSMR.hpp"
51 #include "services/classLoadingService.hpp"
52 #include "services/diagnosticCommand.hpp"
53 #include "services/diagnosticFramework.hpp"
54 #include "services/writeableFlags.hpp"
55 #include "services/heapDumper.hpp"
56 #include "services/lowMemoryDetector.hpp"
57 #include "services/gcNotifier.hpp"
58 #include "services/nmtDCmd.hpp"
59 #include "services/management.hpp"
60 #include "services/memoryManager.hpp"
61 #include "services/memoryPool.hpp"
62 #include "services/memoryService.hpp"
63 #include "services/runtimeService.hpp"
64 #include "services/threadService.hpp"
65 #include "utilities/debug.hpp"
66 #include "utilities/formatBuffer.hpp"
131
132 _optional_support.isObjectMonitorUsageSupported = 1;
133 #if INCLUDE_SERVICES
134 // This depends on the heap inspector
135 _optional_support.isSynchronizerUsageSupported = 1;
136 #endif // INCLUDE_SERVICES
137 _optional_support.isThreadAllocatedMemorySupported = 1;
138 _optional_support.isRemoteDiagnosticCommandsSupported = 1;
139
140 // Registration of the diagnostic commands
141 DCmdRegistrant::register_dcmds();
142 DCmdRegistrant::register_dcmds_ext();
143 uint32_t full_export = DCmd_Source_Internal | DCmd_Source_AttachAPI
144 | DCmd_Source_MBean;
145 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<NMTDCmd>(full_export, true, false));
146 }
147
148 void Management::initialize(TRAPS) {
149 // Start the service thread
150 ServiceThread::initialize();
151
152 if (ManagementServer) {
153 ResourceMark rm(THREAD);
154 HandleMark hm(THREAD);
155
156 // Load and initialize the jdk.internal.agent.Agent class
157 // invoke startAgent method to start the management server
158 Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
159 Klass* k = SystemDictionary::resolve_or_null(vmSymbols::jdk_internal_agent_Agent(),
160 loader,
161 Handle(),
162 THREAD);
163 if (k == NULL) {
164 vm_exit_during_initialization("Management agent initialization failure: "
165 "class jdk.internal.agent.Agent not found.");
166 }
167
168 JavaValue result(T_VOID);
169 JavaCalls::call_static(&result,
170 k,
|
27 #include "classfile/classLoader.hpp"
28 #include "classfile/systemDictionary.hpp"
29 #include "compiler/compileBroker.hpp"
30 #include "memory/allocation.inline.hpp"
31 #include "memory/iterator.hpp"
32 #include "memory/oopFactory.hpp"
33 #include "memory/resourceArea.hpp"
34 #include "memory/universe.hpp"
35 #include "oops/klass.hpp"
36 #include "oops/objArrayKlass.hpp"
37 #include "oops/objArrayOop.inline.hpp"
38 #include "oops/oop.inline.hpp"
39 #include "oops/typeArrayOop.inline.hpp"
40 #include "runtime/arguments.hpp"
41 #include "runtime/flags/jvmFlag.hpp"
42 #include "runtime/globals.hpp"
43 #include "runtime/handles.inline.hpp"
44 #include "runtime/interfaceSupport.inline.hpp"
45 #include "runtime/javaCalls.hpp"
46 #include "runtime/jniHandles.inline.hpp"
47 #include "runtime/notificationThread.hpp"
48 #include "runtime/os.hpp"
49 #include "runtime/serviceThread.hpp"
50 #include "runtime/thread.inline.hpp"
51 #include "runtime/threadSMR.hpp"
52 #include "services/classLoadingService.hpp"
53 #include "services/diagnosticCommand.hpp"
54 #include "services/diagnosticFramework.hpp"
55 #include "services/writeableFlags.hpp"
56 #include "services/heapDumper.hpp"
57 #include "services/lowMemoryDetector.hpp"
58 #include "services/gcNotifier.hpp"
59 #include "services/nmtDCmd.hpp"
60 #include "services/management.hpp"
61 #include "services/memoryManager.hpp"
62 #include "services/memoryPool.hpp"
63 #include "services/memoryService.hpp"
64 #include "services/runtimeService.hpp"
65 #include "services/threadService.hpp"
66 #include "utilities/debug.hpp"
67 #include "utilities/formatBuffer.hpp"
132
133 _optional_support.isObjectMonitorUsageSupported = 1;
134 #if INCLUDE_SERVICES
135 // This depends on the heap inspector
136 _optional_support.isSynchronizerUsageSupported = 1;
137 #endif // INCLUDE_SERVICES
138 _optional_support.isThreadAllocatedMemorySupported = 1;
139 _optional_support.isRemoteDiagnosticCommandsSupported = 1;
140
141 // Registration of the diagnostic commands
142 DCmdRegistrant::register_dcmds();
143 DCmdRegistrant::register_dcmds_ext();
144 uint32_t full_export = DCmd_Source_Internal | DCmd_Source_AttachAPI
145 | DCmd_Source_MBean;
146 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<NMTDCmd>(full_export, true, false));
147 }
148
149 void Management::initialize(TRAPS) {
150 // Start the service thread
151 ServiceThread::initialize();
152 NotificationThread::initialize();
153
154 if (ManagementServer) {
155 ResourceMark rm(THREAD);
156 HandleMark hm(THREAD);
157
158 // Load and initialize the jdk.internal.agent.Agent class
159 // invoke startAgent method to start the management server
160 Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
161 Klass* k = SystemDictionary::resolve_or_null(vmSymbols::jdk_internal_agent_Agent(),
162 loader,
163 Handle(),
164 THREAD);
165 if (k == NULL) {
166 vm_exit_during_initialization("Management agent initialization failure: "
167 "class jdk.internal.agent.Agent not found.");
168 }
169
170 JavaValue result(T_VOID);
171 JavaCalls::call_static(&result,
172 k,
|