author | jlaskey |
Tue, 23 Jul 2013 12:00:29 -0300 | |
changeset 19089 | 51cfdcf21d35 |
parent 18025 | b7bcf7497f93 |
child 21076 | 7cea9d36a46e |
child 20662 | 3296bf2cc204 |
permissions | -rw-r--r-- |
11209 | 1 |
/* |
15437 | 2 |
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. |
11209 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#include "precompiled.hpp" |
|
11441 | 26 |
#include "gc_implementation/shared/vmGCOperations.hpp" |
27 |
#include "runtime/javaCalls.hpp" |
|
11209 | 28 |
#include "services/diagnosticArgument.hpp" |
29 |
#include "services/diagnosticCommand.hpp" |
|
30 |
#include "services/diagnosticFramework.hpp" |
|
11441 | 31 |
#include "services/heapDumper.hpp" |
32 |
#include "services/management.hpp" |
|
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
13977
diff
changeset
|
33 |
#include "utilities/macros.hpp" |
11209 | 34 |
|
11598
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
35 |
void DCmdRegistrant::register_dcmds(){ |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
36 |
// Registration of the diagnostic commands |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
37 |
// First argument specifies which interfaces will export the command |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
38 |
// Second argument specifies if the command is enabled |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
39 |
// Third argument specifies if the command is hidden |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
40 |
uint32_t full_export = DCmd_Source_Internal | DCmd_Source_AttachAPI |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
41 |
| DCmd_Source_MBean; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
42 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HelpDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
43 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VersionDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
44 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CommandLineDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
45 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintSystemPropertiesDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
46 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintVMFlagsDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
47 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
48 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
49 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false)); |
15437 | 50 |
#if INCLUDE_SERVICES // Heap dumping/inspection supported |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
51 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
52 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
53 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false)); |
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13728
diff
changeset
|
54 |
#endif // INCLUDE_SERVICES |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
55 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
56 |
|
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
57 |
// Enhanced JMX Agent Support |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
58 |
// These commands won't be exported via the DiagnosticCommandMBean until an |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
59 |
// appropriate permission is created for them |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
60 |
uint32_t jmx_agent_export_flags = DCmd_Source_Internal | DCmd_Source_AttachAPI; |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
61 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartRemoteDCmd>(jmx_agent_export_flags, true,false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
62 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartLocalDCmd>(jmx_agent_export_flags, true,false)); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
63 |
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStopRemoteDCmd>(jmx_agent_export_flags, true,false)); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
64 |
|
11598
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
65 |
} |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
66 |
|
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
67 |
#ifndef HAVE_EXTRA_DCMD |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
68 |
void DCmdRegistrant::register_dcmds_ext(){ |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
69 |
// Do nothing here |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
70 |
} |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
71 |
#endif |
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
72 |
|
db8931f2a56d
7132515: Add dcmd to manage UnlockingCommercialFeature flag
dsamersoff
parents:
11441
diff
changeset
|
73 |
|
11441 | 74 |
HelpDCmd::HelpDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap), |
11209 | 75 |
_all("-all", "Show help for all commands", "BOOLEAN", false, "false"), |
76 |
_cmd("command name", "The name of the command for which we want help", |
|
77 |
"STRING", false) { |
|
78 |
_dcmdparser.add_dcmd_option(&_all); |
|
79 |
_dcmdparser.add_dcmd_argument(&_cmd); |
|
80 |
}; |
|
81 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
82 |
void HelpDCmd::execute(DCmdSource source, TRAPS) { |
11209 | 83 |
if (_all.value()) { |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
84 |
GrowableArray<const char*>* cmd_list = DCmdFactory::DCmd_list(source); |
11209 | 85 |
for (int i = 0; i < cmd_list->length(); i++) { |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
86 |
DCmdFactory* factory = DCmdFactory::factory(source, cmd_list->at(i), |
11209 | 87 |
strlen(cmd_list->at(i))); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
88 |
output()->print_cr("%s%s", factory->name(), |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
89 |
factory->is_enabled() ? "" : " [disabled]"); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
90 |
output()->print_cr("\t%s", factory->description()); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
91 |
output()->cr(); |
11209 | 92 |
factory = factory->next(); |
93 |
} |
|
94 |
} else if (_cmd.has_value()) { |
|
95 |
DCmd* cmd = NULL; |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
96 |
DCmdFactory* factory = DCmdFactory::factory(source, _cmd.value(), |
11209 | 97 |
strlen(_cmd.value())); |
98 |
if (factory != NULL) { |
|
99 |
output()->print_cr("%s%s", factory->name(), |
|
100 |
factory->is_enabled() ? "" : " [disabled]"); |
|
101 |
output()->print_cr(factory->description()); |
|
102 |
output()->print_cr("\nImpact: %s", factory->impact()); |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
103 |
JavaPermission p = factory->permission(); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
104 |
if(p._class != NULL) { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
105 |
if(p._action != NULL) { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
106 |
output()->print_cr("\nPermission: %s(%s, %s)", |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
107 |
p._class, p._name == NULL ? "null" : p._name, p._action); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
108 |
} else { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
109 |
output()->print_cr("\nPermission: %s(%s)", |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
110 |
p._class, p._name == NULL ? "null" : p._name); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
111 |
} |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
112 |
} |
11441 | 113 |
output()->cr(); |
11209 | 114 |
cmd = factory->create_resource_instance(output()); |
115 |
if (cmd != NULL) { |
|
116 |
DCmdMark mark(cmd); |
|
11441 | 117 |
cmd->print_help(factory->name()); |
11209 | 118 |
} |
119 |
} else { |
|
120 |
output()->print_cr("Help unavailable : '%s' : No such command", _cmd.value()); |
|
121 |
} |
|
122 |
} else { |
|
123 |
output()->print_cr("The following commands are available:"); |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
124 |
GrowableArray<const char *>* cmd_list = DCmdFactory::DCmd_list(source); |
11209 | 125 |
for (int i = 0; i < cmd_list->length(); i++) { |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
126 |
DCmdFactory* factory = DCmdFactory::factory(source, cmd_list->at(i), |
11209 | 127 |
strlen(cmd_list->at(i))); |
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
128 |
output()->print_cr("%s%s", factory->name(), |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
129 |
factory->is_enabled() ? "" : " [disabled]"); |
11209 | 130 |
factory = factory->_next; |
131 |
} |
|
132 |
output()->print_cr("\nFor more information about a specific command use 'help <command>'."); |
|
133 |
} |
|
134 |
} |
|
135 |
||
136 |
int HelpDCmd::num_arguments() { |
|
137 |
ResourceMark rm; |
|
138 |
HelpDCmd* dcmd = new HelpDCmd(NULL, false); |
|
139 |
if (dcmd != NULL) { |
|
140 |
DCmdMark mark(dcmd); |
|
141 |
return dcmd->_dcmdparser.num_arguments(); |
|
142 |
} else { |
|
143 |
return 0; |
|
144 |
} |
|
145 |
} |
|
146 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
147 |
void VersionDCmd::execute(DCmdSource source, TRAPS) { |
11209 | 148 |
output()->print_cr("%s version %s", Abstract_VM_Version::vm_name(), |
149 |
Abstract_VM_Version::vm_release()); |
|
150 |
JDK_Version jdk_version = JDK_Version::current(); |
|
151 |
if (jdk_version.update_version() > 0) { |
|
152 |
output()->print_cr("JDK %d.%d_%02d", jdk_version.major_version(), |
|
153 |
jdk_version.minor_version(), jdk_version.update_version()); |
|
154 |
} else { |
|
155 |
output()->print_cr("JDK %d.%d", jdk_version.major_version(), |
|
156 |
jdk_version.minor_version()); |
|
157 |
} |
|
158 |
} |
|
11441 | 159 |
|
160 |
PrintVMFlagsDCmd::PrintVMFlagsDCmd(outputStream* output, bool heap) : |
|
161 |
DCmdWithParser(output, heap), |
|
162 |
_all("-all", "Print all flags supported by the VM", "BOOLEAN", false, "false") { |
|
163 |
_dcmdparser.add_dcmd_option(&_all); |
|
164 |
} |
|
165 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
166 |
void PrintVMFlagsDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 167 |
if (_all.value()) { |
168 |
CommandLineFlags::printFlags(output(), true); |
|
169 |
} else { |
|
170 |
CommandLineFlags::printSetFlags(output()); |
|
171 |
} |
|
172 |
} |
|
173 |
||
174 |
int PrintVMFlagsDCmd::num_arguments() { |
|
175 |
ResourceMark rm; |
|
176 |
PrintVMFlagsDCmd* dcmd = new PrintVMFlagsDCmd(NULL, false); |
|
177 |
if (dcmd != NULL) { |
|
178 |
DCmdMark mark(dcmd); |
|
179 |
return dcmd->_dcmdparser.num_arguments(); |
|
180 |
} else { |
|
181 |
return 0; |
|
182 |
} |
|
183 |
} |
|
184 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
185 |
void PrintSystemPropertiesDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 186 |
// load sun.misc.VMSupport |
187 |
Symbol* klass = vmSymbols::sun_misc_VMSupport(); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11953
diff
changeset
|
188 |
Klass* k = SystemDictionary::resolve_or_fail(klass, true, CHECK); |
11441 | 189 |
instanceKlassHandle ik (THREAD, k); |
190 |
if (ik->should_be_initialized()) { |
|
191 |
ik->initialize(THREAD); |
|
192 |
} |
|
193 |
if (HAS_PENDING_EXCEPTION) { |
|
194 |
java_lang_Throwable::print(PENDING_EXCEPTION, output()); |
|
195 |
output()->cr(); |
|
196 |
CLEAR_PENDING_EXCEPTION; |
|
197 |
return; |
|
198 |
} |
|
199 |
||
200 |
// invoke the serializePropertiesToByteArray method |
|
201 |
JavaValue result(T_OBJECT); |
|
202 |
JavaCallArguments args; |
|
203 |
||
204 |
Symbol* signature = vmSymbols::serializePropertiesToByteArray_signature(); |
|
205 |
JavaCalls::call_static(&result, |
|
206 |
ik, |
|
207 |
vmSymbols::serializePropertiesToByteArray_name(), |
|
208 |
signature, |
|
209 |
&args, |
|
210 |
THREAD); |
|
211 |
if (HAS_PENDING_EXCEPTION) { |
|
212 |
java_lang_Throwable::print(PENDING_EXCEPTION, output()); |
|
213 |
output()->cr(); |
|
214 |
CLEAR_PENDING_EXCEPTION; |
|
215 |
return; |
|
216 |
} |
|
217 |
||
218 |
// The result should be a [B |
|
219 |
oop res = (oop)result.get_jobject(); |
|
220 |
assert(res->is_typeArray(), "just checking"); |
|
13952
e3cf184080bc
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
13728
diff
changeset
|
221 |
assert(TypeArrayKlass::cast(res->klass())->element_type() == T_BYTE, "just checking"); |
11441 | 222 |
|
223 |
// copy the bytes to the output stream |
|
224 |
typeArrayOop ba = typeArrayOop(res); |
|
225 |
jbyte* addr = typeArrayOop(res)->byte_at_addr(0); |
|
226 |
output()->print_raw((const char*)addr, ba->length()); |
|
227 |
} |
|
228 |
||
229 |
VMUptimeDCmd::VMUptimeDCmd(outputStream* output, bool heap) : |
|
230 |
DCmdWithParser(output, heap), |
|
231 |
_date("-date", "Add a prefix with current date", "BOOLEAN", false, "false") { |
|
232 |
_dcmdparser.add_dcmd_option(&_date); |
|
233 |
} |
|
234 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
235 |
void VMUptimeDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 236 |
if (_date.value()) { |
237 |
output()->date_stamp(true, "", ": "); |
|
238 |
} |
|
239 |
output()->time_stamp().update_to(tty->time_stamp().ticks()); |
|
240 |
output()->stamp(); |
|
241 |
output()->print_cr(" s"); |
|
242 |
} |
|
243 |
||
244 |
int VMUptimeDCmd::num_arguments() { |
|
245 |
ResourceMark rm; |
|
246 |
VMUptimeDCmd* dcmd = new VMUptimeDCmd(NULL, false); |
|
247 |
if (dcmd != NULL) { |
|
248 |
DCmdMark mark(dcmd); |
|
249 |
return dcmd->_dcmdparser.num_arguments(); |
|
250 |
} else { |
|
251 |
return 0; |
|
252 |
} |
|
253 |
} |
|
254 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
255 |
void SystemGCDCmd::execute(DCmdSource source, TRAPS) { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
256 |
if (!DisableExplicitGC) { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
257 |
Universe::heap()->collect(GCCause::_java_lang_system_gc); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
258 |
} else { |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
259 |
output()->print_cr("Explicit GC is disabled, no GC has been performed."); |
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
260 |
} |
11441 | 261 |
} |
262 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
263 |
void RunFinalizationDCmd::execute(DCmdSource source, TRAPS) { |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11953
diff
changeset
|
264 |
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), |
11441 | 265 |
true, CHECK); |
266 |
instanceKlassHandle klass(THREAD, k); |
|
267 |
JavaValue result(T_VOID); |
|
268 |
JavaCalls::call_static(&result, klass, |
|
269 |
vmSymbols::run_finalization_name(), |
|
270 |
vmSymbols::void_method_signature(), CHECK); |
|
271 |
} |
|
272 |
||
15437 | 273 |
#if INCLUDE_SERVICES // Heap dumping/inspection supported |
11441 | 274 |
HeapDumpDCmd::HeapDumpDCmd(outputStream* output, bool heap) : |
275 |
DCmdWithParser(output, heap), |
|
276 |
_filename("filename","Name of the dump file", "STRING",true), |
|
277 |
_all("-all", "Dump all objects, including unreachable objects", |
|
278 |
"BOOLEAN", false, "false") { |
|
279 |
_dcmdparser.add_dcmd_option(&_all); |
|
280 |
_dcmdparser.add_dcmd_argument(&_filename); |
|
281 |
} |
|
282 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
283 |
void HeapDumpDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 284 |
// Request a full GC before heap dump if _all is false |
285 |
// This helps reduces the amount of unreachable objects in the dump |
|
286 |
// and makes it easier to browse. |
|
287 |
HeapDumper dumper(!_all.value() /* request GC if _all is false*/); |
|
288 |
int res = dumper.dump(_filename.value()); |
|
289 |
if (res == 0) { |
|
290 |
output()->print_cr("Heap dump file created"); |
|
291 |
} else { |
|
292 |
// heap dump failed |
|
293 |
ResourceMark rm; |
|
294 |
char* error = dumper.error_as_C_string(); |
|
295 |
if (error == NULL) { |
|
296 |
output()->print_cr("Dump failed - reason unknown"); |
|
297 |
} else { |
|
298 |
output()->print_cr("%s", error); |
|
299 |
} |
|
300 |
} |
|
301 |
} |
|
302 |
||
303 |
int HeapDumpDCmd::num_arguments() { |
|
304 |
ResourceMark rm; |
|
305 |
HeapDumpDCmd* dcmd = new HeapDumpDCmd(NULL, false); |
|
306 |
if (dcmd != NULL) { |
|
307 |
DCmdMark mark(dcmd); |
|
308 |
return dcmd->_dcmdparser.num_arguments(); |
|
309 |
} else { |
|
310 |
return 0; |
|
311 |
} |
|
312 |
} |
|
313 |
||
314 |
ClassHistogramDCmd::ClassHistogramDCmd(outputStream* output, bool heap) : |
|
315 |
DCmdWithParser(output, heap), |
|
316 |
_all("-all", "Inspect all objects, including unreachable objects", |
|
317 |
"BOOLEAN", false, "false") { |
|
318 |
_dcmdparser.add_dcmd_option(&_all); |
|
319 |
} |
|
320 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
321 |
void ClassHistogramDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 322 |
VM_GC_HeapInspection heapop(output(), |
18025 | 323 |
!_all.value() /* request full gc if false */); |
11441 | 324 |
VMThread::execute(&heapop); |
325 |
} |
|
326 |
||
327 |
int ClassHistogramDCmd::num_arguments() { |
|
328 |
ResourceMark rm; |
|
329 |
ClassHistogramDCmd* dcmd = new ClassHistogramDCmd(NULL, false); |
|
330 |
if (dcmd != NULL) { |
|
331 |
DCmdMark mark(dcmd); |
|
332 |
return dcmd->_dcmdparser.num_arguments(); |
|
333 |
} else { |
|
334 |
return 0; |
|
335 |
} |
|
336 |
} |
|
337 |
||
15437 | 338 |
#define DEFAULT_COLUMNS "InstBytes,KlassBytes,CpAll,annotations,MethodCount,Bytecodes,MethodAll,ROAll,RWAll,Total" |
339 |
ClassStatsDCmd::ClassStatsDCmd(outputStream* output, bool heap) : |
|
340 |
DCmdWithParser(output, heap), |
|
341 |
_csv("-csv", "Print in CSV (comma-separated values) format for spreadsheets", |
|
342 |
"BOOLEAN", false, "false"), |
|
343 |
_all("-all", "Show all columns", |
|
344 |
"BOOLEAN", false, "false"), |
|
345 |
_help("-help", "Show meaning of all the columns", |
|
346 |
"BOOLEAN", false, "false"), |
|
347 |
_columns("columns", "Comma-separated list of all the columns to show. " |
|
348 |
"If not specified, the following columns are shown: " DEFAULT_COLUMNS, |
|
349 |
"STRING", false) { |
|
350 |
_dcmdparser.add_dcmd_option(&_all); |
|
351 |
_dcmdparser.add_dcmd_option(&_csv); |
|
352 |
_dcmdparser.add_dcmd_option(&_help); |
|
353 |
_dcmdparser.add_dcmd_argument(&_columns); |
|
354 |
} |
|
355 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
356 |
void ClassStatsDCmd::execute(DCmdSource source, TRAPS) { |
15437 | 357 |
if (!UnlockDiagnosticVMOptions) { |
358 |
output()->print_cr("GC.class_stats command requires -XX:+UnlockDiagnosticVMOptions"); |
|
359 |
return; |
|
360 |
} |
|
361 |
||
362 |
VM_GC_HeapInspection heapop(output(), |
|
18025 | 363 |
true /* request_full_gc */); |
15437 | 364 |
heapop.set_csv_format(_csv.value()); |
365 |
heapop.set_print_help(_help.value()); |
|
366 |
heapop.set_print_class_stats(true); |
|
367 |
if (_all.value()) { |
|
368 |
if (_columns.has_value()) { |
|
369 |
output()->print_cr("Cannot specify -all and individual columns at the same time"); |
|
370 |
return; |
|
371 |
} else { |
|
372 |
heapop.set_columns(NULL); |
|
373 |
} |
|
374 |
} else { |
|
375 |
if (_columns.has_value()) { |
|
376 |
heapop.set_columns(_columns.value()); |
|
377 |
} else { |
|
378 |
heapop.set_columns(DEFAULT_COLUMNS); |
|
379 |
} |
|
380 |
} |
|
381 |
VMThread::execute(&heapop); |
|
382 |
} |
|
383 |
||
384 |
int ClassStatsDCmd::num_arguments() { |
|
385 |
ResourceMark rm; |
|
386 |
ClassStatsDCmd* dcmd = new ClassStatsDCmd(NULL, false); |
|
387 |
if (dcmd != NULL) { |
|
388 |
DCmdMark mark(dcmd); |
|
389 |
return dcmd->_dcmdparser.num_arguments(); |
|
390 |
} else { |
|
391 |
return 0; |
|
392 |
} |
|
393 |
} |
|
394 |
#endif // INCLUDE_SERVICES |
|
395 |
||
11441 | 396 |
ThreadDumpDCmd::ThreadDumpDCmd(outputStream* output, bool heap) : |
397 |
DCmdWithParser(output, heap), |
|
398 |
_locks("-l", "print java.util.concurrent locks", "BOOLEAN", false, "false") { |
|
399 |
_dcmdparser.add_dcmd_option(&_locks); |
|
400 |
} |
|
401 |
||
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
402 |
void ThreadDumpDCmd::execute(DCmdSource source, TRAPS) { |
11441 | 403 |
// thread stacks |
404 |
VM_PrintThreads op1(output(), _locks.value()); |
|
405 |
VMThread::execute(&op1); |
|
406 |
||
407 |
// JNI global handles |
|
408 |
VM_PrintJNI op2(output()); |
|
409 |
VMThread::execute(&op2); |
|
410 |
||
411 |
// Deadlock detection |
|
412 |
VM_FindDeadlocks op3(output()); |
|
413 |
VMThread::execute(&op3); |
|
414 |
} |
|
415 |
||
416 |
int ThreadDumpDCmd::num_arguments() { |
|
417 |
ResourceMark rm; |
|
418 |
ThreadDumpDCmd* dcmd = new ThreadDumpDCmd(NULL, false); |
|
419 |
if (dcmd != NULL) { |
|
420 |
DCmdMark mark(dcmd); |
|
421 |
return dcmd->_dcmdparser.num_arguments(); |
|
422 |
} else { |
|
423 |
return 0; |
|
424 |
} |
|
425 |
} |
|
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
426 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
427 |
// Enhanced JMX Agent support |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
428 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
429 |
JMXStartRemoteDCmd::JMXStartRemoteDCmd(outputStream *output, bool heap_allocated) : |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
430 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
431 |
DCmdWithParser(output, heap_allocated), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
432 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
433 |
_config_file |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
434 |
("config.file", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
435 |
"set com.sun.management.config.file", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
436 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
437 |
_jmxremote_port |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
438 |
("jmxremote.port", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
439 |
"set com.sun.management.jmxremote.port", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
440 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
441 |
_jmxremote_rmi_port |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
442 |
("jmxremote.rmi.port", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
443 |
"set com.sun.management.jmxremote.rmi.port", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
444 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
445 |
_jmxremote_ssl |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
446 |
("jmxremote.ssl", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
447 |
"set com.sun.management.jmxremote.ssl", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
448 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
449 |
_jmxremote_registry_ssl |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
450 |
("jmxremote.registry.ssl", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
451 |
"set com.sun.management.jmxremote.registry.ssl", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
452 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
453 |
_jmxremote_authenticate |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
454 |
("jmxremote.authenticate", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
455 |
"set com.sun.management.jmxremote.authenticate", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
456 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
457 |
_jmxremote_password_file |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
458 |
("jmxremote.password.file", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
459 |
"set com.sun.management.jmxremote.password.file", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
460 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
461 |
_jmxremote_access_file |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
462 |
("jmxremote.access.file", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
463 |
"set com.sun.management.jmxremote.access.file", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
464 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
465 |
_jmxremote_login_config |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
466 |
("jmxremote.login.config", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
467 |
"set com.sun.management.jmxremote.login.config", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
468 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
469 |
_jmxremote_ssl_enabled_cipher_suites |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
470 |
("jmxremote.ssl.enabled.cipher.suites", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
471 |
"set com.sun.management.jmxremote.ssl.enabled.cipher.suite", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
472 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
473 |
_jmxremote_ssl_enabled_protocols |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
474 |
("jmxremote.ssl.enabled.protocols", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
475 |
"set com.sun.management.jmxremote.ssl.enabled.protocols", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
476 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
477 |
_jmxremote_ssl_need_client_auth |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
478 |
("jmxremote.ssl.need.client.auth", |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
479 |
"set com.sun.management.jmxremote.need.client.auth", "STRING", false), |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
480 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
481 |
_jmxremote_ssl_config_file |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
482 |
("jmxremote.ssl.config.file", |
15460
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
483 |
"set com.sun.management.jmxremote.ssl_config_file", "STRING", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
484 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
485 |
// JDP Protocol support |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
486 |
_jmxremote_autodiscovery |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
487 |
("jmxremote.autodiscovery", |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
488 |
"set com.sun.management.jmxremote.autodiscovery", "STRING", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
489 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
490 |
_jdp_port |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
491 |
("jdp.port", |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
492 |
"set com.sun.management.jdp.port", "INT", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
493 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
494 |
_jdp_address |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
495 |
("jdp.address", |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
496 |
"set com.sun.management.jdp.address", "STRING", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
497 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
498 |
_jdp_source_addr |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
499 |
("jdp.source_addr", |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
500 |
"set com.sun.management.jdp.source_addr", "STRING", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
501 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
502 |
_jdp_ttl |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
503 |
("jdp.ttl", |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
504 |
"set com.sun.management.jdp.ttl", "INT", false), |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
505 |
|
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
506 |
_jdp_pause |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
507 |
("jdp.pause", |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
508 |
"set com.sun.management.jdp.pause", "INT", false) |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
509 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
510 |
{ |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
511 |
_dcmdparser.add_dcmd_option(&_config_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
512 |
_dcmdparser.add_dcmd_option(&_jmxremote_port); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
513 |
_dcmdparser.add_dcmd_option(&_jmxremote_rmi_port); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
514 |
_dcmdparser.add_dcmd_option(&_jmxremote_ssl); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
515 |
_dcmdparser.add_dcmd_option(&_jmxremote_registry_ssl); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
516 |
_dcmdparser.add_dcmd_option(&_jmxremote_authenticate); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
517 |
_dcmdparser.add_dcmd_option(&_jmxremote_password_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
518 |
_dcmdparser.add_dcmd_option(&_jmxremote_access_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
519 |
_dcmdparser.add_dcmd_option(&_jmxremote_login_config); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
520 |
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_enabled_cipher_suites); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
521 |
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_enabled_protocols); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
522 |
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_need_client_auth); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
523 |
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_config_file); |
15460
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
524 |
_dcmdparser.add_dcmd_option(&_jmxremote_autodiscovery); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
525 |
_dcmdparser.add_dcmd_option(&_jdp_port); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
526 |
_dcmdparser.add_dcmd_option(&_jdp_address); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
527 |
_dcmdparser.add_dcmd_option(&_jdp_source_addr); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
528 |
_dcmdparser.add_dcmd_option(&_jdp_ttl); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
529 |
_dcmdparser.add_dcmd_option(&_jdp_pause); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
530 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
531 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
532 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
533 |
int JMXStartRemoteDCmd::num_arguments() { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
534 |
ResourceMark rm; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
535 |
JMXStartRemoteDCmd* dcmd = new JMXStartRemoteDCmd(NULL, false); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
536 |
if (dcmd != NULL) { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
537 |
DCmdMark mark(dcmd); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
538 |
return dcmd->_dcmdparser.num_arguments(); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
539 |
} else { |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
540 |
return 0; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
541 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
542 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
543 |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
544 |
|
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
545 |
void JMXStartRemoteDCmd::execute(DCmdSource source, TRAPS) { |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
546 |
ResourceMark rm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
547 |
HandleMark hm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
548 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
549 |
// Load and initialize the sun.management.Agent class |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
550 |
// invoke startRemoteManagementAgent(string) method to start |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
551 |
// the remote management server. |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
552 |
// throw java.lang.NoSuchMethodError if the method doesn't exist |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
553 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
554 |
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader()); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11953
diff
changeset
|
555 |
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
556 |
instanceKlassHandle ik (THREAD, k); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
557 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
558 |
JavaValue result(T_VOID); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
559 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
560 |
// Pass all command line arguments to java as key=value,... |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
561 |
// All checks are done on java side |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
562 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
563 |
int len = 0; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
564 |
stringStream options; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
565 |
char comma[2] = {0,0}; |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
566 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
567 |
// Leave default values on Agent.class side and pass only |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
568 |
// agruments explicitly set by user. All arguments passed |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
569 |
// to jcmd override properties with the same name set by |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
570 |
// command line with -D or by managmenent.properties |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
571 |
// file. |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
572 |
#define PUT_OPTION(a) \ |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
573 |
if ( (a).is_set() ){ \ |
15460
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
574 |
options.print(\ |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
575 |
( *((a).type()) == 'I' ) ? "%scom.sun.management.%s=%d" : "%scom.sun.management.%s=%s",\ |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
576 |
comma, (a).name(), (a).value()); \ |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
577 |
comma[0] = ','; \ |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
578 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
579 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
580 |
PUT_OPTION(_config_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
581 |
PUT_OPTION(_jmxremote_port); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
582 |
PUT_OPTION(_jmxremote_rmi_port); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
583 |
PUT_OPTION(_jmxremote_ssl); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
584 |
PUT_OPTION(_jmxremote_registry_ssl); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
585 |
PUT_OPTION(_jmxremote_authenticate); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
586 |
PUT_OPTION(_jmxremote_password_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
587 |
PUT_OPTION(_jmxremote_access_file); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
588 |
PUT_OPTION(_jmxremote_login_config); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
589 |
PUT_OPTION(_jmxremote_ssl_enabled_cipher_suites); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
590 |
PUT_OPTION(_jmxremote_ssl_enabled_protocols); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
591 |
PUT_OPTION(_jmxremote_ssl_need_client_auth); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
592 |
PUT_OPTION(_jmxremote_ssl_config_file); |
15460
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
593 |
PUT_OPTION(_jmxremote_autodiscovery); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
594 |
PUT_OPTION(_jdp_port); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
595 |
PUT_OPTION(_jdp_address); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
596 |
PUT_OPTION(_jdp_source_addr); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
597 |
PUT_OPTION(_jdp_ttl); |
ac08a4bdd0f6
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
15437
diff
changeset
|
598 |
PUT_OPTION(_jdp_pause); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
599 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
600 |
#undef PUT_OPTION |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
601 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
602 |
Handle str = java_lang_String::create_from_str(options.as_string(), CHECK); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
603 |
JavaCalls::call_static(&result, ik, vmSymbols::startRemoteAgent_name(), vmSymbols::string_void_signature(), str, CHECK); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
604 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
605 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
606 |
JMXStartLocalDCmd::JMXStartLocalDCmd(outputStream *output, bool heap_allocated) : |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
607 |
DCmd(output, heap_allocated) |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
608 |
{ |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
609 |
// do nothing |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
610 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
611 |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
612 |
void JMXStartLocalDCmd::execute(DCmdSource source, TRAPS) { |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
613 |
ResourceMark rm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
614 |
HandleMark hm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
615 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
616 |
// Load and initialize the sun.management.Agent class |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
617 |
// invoke startLocalManagementAgent(void) method to start |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
618 |
// the local management server |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
619 |
// throw java.lang.NoSuchMethodError if method doesn't exist |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
620 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
621 |
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader()); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11953
diff
changeset
|
622 |
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
623 |
instanceKlassHandle ik (THREAD, k); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
624 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
625 |
JavaValue result(T_VOID); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
626 |
JavaCalls::call_static(&result, ik, vmSymbols::startLocalAgent_name(), vmSymbols::void_method_signature(), CHECK); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
627 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
628 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
629 |
|
17296
68557efd8583
8004095: Add support for JMX interface to Diagnostic Framework and Commands
fparain
parents:
15484
diff
changeset
|
630 |
void JMXStopRemoteDCmd::execute(DCmdSource source, TRAPS) { |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
631 |
ResourceMark rm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
632 |
HandleMark hm(THREAD); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
633 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
634 |
// Load and initialize the sun.management.Agent class |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
635 |
// invoke stopRemoteManagementAgent method to stop the |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
636 |
// management server |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
637 |
// throw java.lang.NoSuchMethodError if method doesn't exist |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
638 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
639 |
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader()); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11953
diff
changeset
|
640 |
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK); |
11953
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
641 |
instanceKlassHandle ik (THREAD, k); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
642 |
|
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
643 |
JavaValue result(T_VOID); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
644 |
JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK); |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
645 |
} |
d06edd28ba62
7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
11598
diff
changeset
|
646 |