Getting warnings and listening for new system messages

Use the SystemMonitorMXBean API to get a list of warning messages that are collected by a runtime server, as well as to clear the collected warnings on the server, or to set a listener to get notified whenever a warning message is collected.

Before you begin

The warningEnabled property must be enabled.

About this task

The SystemMonitorMXBean returns only the warning messages of the runtime server to which the MBean connection is established for.

Procedure