139 uint32_t full_export = DCmd_Source_Internal | DCmd_Source_AttachAPI
140 | DCmd_Source_MBean;
141 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<NMTDCmd>(full_export, true, false));
142 }
143
144 void Management::initialize(TRAPS) {
145 // Start the service thread
146 ServiceThread::initialize();
147
148 if (ManagementServer) {
149 ResourceMark rm(THREAD);
150 HandleMark hm(THREAD);
151
152 // Load and initialize the sun.management.Agent class
153 // invoke startAgent method to start the management server
154 Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
155 Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(),
156 loader,
157 Handle(),
158 true,
159 CHECK);
160 instanceKlassHandle ik (THREAD, k);
161
162 JavaValue result(T_VOID);
163 JavaCalls::call_static(&result,
164 ik,
165 vmSymbols::startAgent_name(),
166 vmSymbols::void_method_signature(),
167 CHECK);
168 }
169 }
170
171 void Management::get_optional_support(jmmOptionalSupport* support) {
172 memcpy(support, &_optional_support, sizeof(jmmOptionalSupport));
173 }
174
175 Klass* Management::load_and_initialize_klass(Symbol* sh, TRAPS) {
176 Klass* k = SystemDictionary::resolve_or_fail(sh, true, CHECK_NULL);
177 instanceKlassHandle ik (THREAD, k);
178 if (ik->should_be_initialized()) {
179 ik->initialize(CHECK_NULL);
|
139 uint32_t full_export = DCmd_Source_Internal | DCmd_Source_AttachAPI
140 | DCmd_Source_MBean;
141 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<NMTDCmd>(full_export, true, false));
142 }
143
144 void Management::initialize(TRAPS) {
145 // Start the service thread
146 ServiceThread::initialize();
147
148 if (ManagementServer) {
149 ResourceMark rm(THREAD);
150 HandleMark hm(THREAD);
151
152 // Load and initialize the sun.management.Agent class
153 // invoke startAgent method to start the management server
154 Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
155 Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(),
156 loader,
157 Handle(),
158 true,
159 THREAD);
160 if (HAS_PENDING_EXCEPTION) {
161 vm_exit_during_initialization("Management agent initialization failure: "
162 "class sun.management.Agent not found.");
163 }
164 instanceKlassHandle ik (THREAD, k);
165
166 JavaValue result(T_VOID);
167 JavaCalls::call_static(&result,
168 ik,
169 vmSymbols::startAgent_name(),
170 vmSymbols::void_method_signature(),
171 CHECK);
172 }
173 }
174
175 void Management::get_optional_support(jmmOptionalSupport* support) {
176 memcpy(support, &_optional_support, sizeof(jmmOptionalSupport));
177 }
178
179 Klass* Management::load_and_initialize_klass(Symbol* sh, TRAPS) {
180 Klass* k = SystemDictionary::resolve_or_fail(sh, true, CHECK_NULL);
181 instanceKlassHandle ik (THREAD, k);
182 if (ik->should_be_initialized()) {
183 ik->initialize(CHECK_NULL);
|