135 136 // Registration of the diagnostic commands 137 DCmdRegistrant::register_dcmds(); 138 DCmdRegistrant::register_dcmds_ext(); 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); | 135 136 // Registration of the diagnostic commands 137 DCmdRegistrant::register_dcmds(); 138 DCmdRegistrant::register_dcmds_ext(); 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_null(vmSymbols::sun_management_Agent(), 156 loader, 157 Handle(), 158 THREAD); 159 if (k == NULL) { 160 vm_exit_during_initialization("Management agent initialization failure: " 161 "class sun.management.Agent not found."); 162 } 163 instanceKlassHandle ik (THREAD, k); 164 165 JavaValue result(T_VOID); 166 JavaCalls::call_static(&result, 167 ik, 168 vmSymbols::startAgent_name(), 169 vmSymbols::void_method_signature(), 170 CHECK); 171 } 172 } 173 174 void Management::get_optional_support(jmmOptionalSupport* support) { 175 memcpy(support, &_optional_support, sizeof(jmmOptionalSupport)); 176 } 177 178 Klass* Management::load_and_initialize_klass(Symbol* sh, TRAPS) { 179 Klass* k = SystemDictionary::resolve_or_fail(sh, true, CHECK_NULL); 180 instanceKlassHandle ik (THREAD, k); 181 if (ik->should_be_initialized()) { 182 ik->initialize(CHECK_NULL); |