Interface IPluginMonitor

    • Field Detail

      • CHECK_SUCCESS

        static final String CHECK_SUCCESS
        The constant for a successful check. Evaluates to "success".
        See Also:
        Constant Field Values
      • CHECK_ERROR

        static final String CHECK_ERROR
        The constant for a non-successful check. Evaluates to "error".
        See Also:
        Constant Field Values
    • Method Detail

      • getObjectName

        default String getObjectName()
        Override this method to define a custom monitor name. Defaults to the name of this class. The monitor key is the key for which the error message returned by check() is displayed.
        Returns:
        The key for this monitor.
      • check

        String check()
              throws Exception
        This method is invoked each time the monitor is refreshed. In case the check was successful, this must return CHECK_SUCCESS. If the check was not successful, you have got the following options:
        • Throw an Exception.
        • Return an error message. This error message is shown by the monitoring MBean. You may return any arbitrary error message string, or use CHECK_ERROR. Make sure you do not return the value of CHECK_SUCCESS, as that is interpreted as a successful check.
        Returns:
        Whether the check was successful or not. To indicate success, return "success". Otherwise, return an appropriate error message.
        Throws:
        Exception - When the check was not successful. The error message is returned to the monitoring MBean.