Skip to content

Commit

Permalink
Add OpenJ9DiagnosticsMXBean.getDumpOptions
Browse files Browse the repository at this point in the history
There should be a getter to match the setter.

Issue eclipse-openj9#20587

Signed-off-by: Peter Shipton <[email protected]>
  • Loading branch information
pshipton committed Nov 19, 2024
1 parent 9464ff3 commit e9bd592
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ public interface OpenJ9DiagnosticsMXBean extends PlatformManagedObject {
*/
public String[] queryDumpOptions();

/**
* Returns the current dump configuration as a comma separated String, or null if an internal error occurs.
* The syntax of the option Strings is the same as the -Xdump command-line option,
* with the initial -Xdump: omitted. See the -Xdump option section on dump agents in
* the documentation for the OpenJ9 JVM.
*
* @throws SecurityException if there is a security manager and it doesn't allow the checks required to read the dump settings
*/
public String getDumpOptions();

/**
* This function sets options for the dump subsystem.
* The dump option is passed in as a String. Use the same syntax as the -Xdump command-line option, with the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,22 @@ public String[] queryDumpOptions() {
}
}

/**
* {@inheritDoc}
*/
@Override
public String getDumpOptions() {
String[] options = queryDumpOptions();
StringBuilder builder = new StringBuilder();
for (int i = 0 i < options.length; i++) {
if (i != 0) {
builder.append(',');
}
builder.append(options[i]);
}
return builder.toString();
}

/**
* {@inheritDoc}
*/
Expand Down

0 comments on commit e9bd592

Please sign in to comment.