@@ -113,7 +113,7 @@ Properties getSystemProperties() {
113
113
}
114
114
return null ;
115
115
} catch (Exception e ) {
116
- LOGGER .throwing ( JmxSupport . class . getName () , "getSystemProperties" , e ); // NOI18N
116
+ LOGGER .log ( Level . INFO , "getSystemProperties" , e ); // NOI18N
117
117
return null ;
118
118
}
119
119
}
@@ -168,22 +168,27 @@ HotSpotDiagnosticMXBean getHotSpotDiagnostic() {
168
168
}
169
169
170
170
String takeThreadDump (long [] threadIds ) {
171
- ThreadMXBean threadMXBean = getThreadBean ();
172
- if (threadMXBean == null ) {
171
+ try {
172
+ ThreadMXBean threadMXBean = getThreadBean ();
173
+ if (threadMXBean == null ) {
174
+ return null ;
175
+ }
176
+ ThreadInfo [] threads ;
177
+ StringBuilder sb = new StringBuilder (4096 );
178
+ SimpleDateFormat df = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss" ); // NOI18N
179
+
180
+ if (hasDumpAllThreads ()) {
181
+ threads = threadMXBean .getThreadInfo (threadIds , true , true );
182
+ } else {
183
+ threads = threadMXBean .getThreadInfo (threadIds , Integer .MAX_VALUE );
184
+ }
185
+ sb .append (df .format (new Date ()) + "\n " ); // NOI18N
186
+ printThreads (sb , threadMXBean , threads );
187
+ return sb .toString ();
188
+ } catch (Exception e ) {
189
+ LOGGER .log (Level .INFO , "takeThreadDump[]" , e ); // NOI18N
173
190
return null ;
174
191
}
175
- ThreadInfo [] threads ;
176
- StringBuilder sb = new StringBuilder (4096 );
177
- SimpleDateFormat df = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss" ); // NOI18N
178
-
179
- if (hasDumpAllThreads ()) {
180
- threads = threadMXBean .getThreadInfo (threadIds , true , true );
181
- } else {
182
- threads = threadMXBean .getThreadInfo (threadIds , Integer .MAX_VALUE );
183
- }
184
- sb .append (df .format (new Date ()) + "\n " ); // NOI18N
185
- printThreads (sb , threadMXBean , threads );
186
- return sb .toString ();
187
192
}
188
193
189
194
String takeThreadDump () {
@@ -337,14 +342,19 @@ boolean takeHeapDump(String fileName) {
337
342
}
338
343
339
344
String getFlagValue (String name ) {
340
- HotSpotDiagnosticMXBean hsDiagnostic = getHotSpotDiagnostic ();
341
- if (hsDiagnostic != null ) {
342
- VMOption option = hsDiagnostic .getVMOption (name );
343
- if (option != null ) {
344
- return option .getValue ();
345
+ try {
346
+ HotSpotDiagnosticMXBean hsDiagnostic = getHotSpotDiagnostic ();
347
+ if (hsDiagnostic != null ) {
348
+ VMOption option = hsDiagnostic .getVMOption (name );
349
+ if (option != null ) {
350
+ return option .getValue ();
351
+ }
345
352
}
353
+ return null ;
354
+ } catch (Exception ex ) {
355
+ LOGGER .log (Level .INFO ,"getFlagValue" , ex ); // NOI18N
356
+ return null ;
346
357
}
347
- return null ;
348
358
}
349
359
350
360
HeapHistogram takeHeapHistogram () {
@@ -373,15 +383,21 @@ HeapHistogram takeHeapHistogram() {
373
383
Exceptions .printStackTrace (ex );
374
384
} catch (ReflectionException ex ) {
375
385
Exceptions .printStackTrace (ex );
376
- }
386
+ } catch (Exception ex ) {
387
+ LOGGER .log (Level .INFO ,"takeHeapHistogram" , ex ); // NOI18N
388
+ }
377
389
}
378
390
return null ;
379
391
}
380
392
381
393
void setFlagValue (String name , String value ) {
394
+ try {
382
395
HotSpotDiagnosticMXBean hsDiagnostic = getHotSpotDiagnostic ();
383
- if (hsDiagnostic != null ) {
384
- hsDiagnostic .setVMOption (name ,value );
396
+ if (hsDiagnostic != null ) {
397
+ hsDiagnostic .setVMOption (name ,value );
398
+ }
399
+ } catch (Exception ex ) {
400
+ LOGGER .log (Level .INFO ,"setFlagValue" , ex ); // NOI18N
385
401
}
386
402
}
387
403
0 commit comments