Class JmsConnectionHealthCheck

  • All Implemented Interfaces:
    HealthCheck

    public class JmsConnectionHealthCheck
    extends java.lang.Object
    implements HealthCheck
    Verifies that a connection to the configured ActiveMQ Broker can be established. In earlier versions of this a timeout was implemented individually. With the introduction of the HealthCheck interface, the HealthCheckService should take care of this.
    Author:
    mvrueden
    • Constructor Summary

      Constructors 
      Constructor Description
      JmsConnectionHealthCheck​(org.osgi.framework.BundleContext bundleContext)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDescription()
      The description of the HealthCheck, e.g.
      java.util.List<java.lang.String> getTags()
      A tag to indicate the category of the health-check.
      Response perform​(Context context)
      Implements the check itself, e.g.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JmsConnectionHealthCheck

        public JmsConnectionHealthCheck​(org.osgi.framework.BundleContext bundleContext)
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: HealthCheck
        The description of the HealthCheck, e.g. "Connecting to OpenNMS ReST API". This is used when visualizing the progress or result of the checks.
        Specified by:
        getDescription in interface HealthCheck
        Returns:
        The string, describing the check.
      • getTags

        public java.util.List<java.lang.String> getTags()
        Description copied from interface: HealthCheck
        A tag to indicate the category of the health-check.
        Specified by:
        getTags in interface HealthCheck
        Returns:
        The HealthTag type, describing category of the health-check.
      • perform

        public Response perform​(Context context)
        Description copied from interface: HealthCheck
        Implements the check itself, e.g. Connecting to a HTTP Endpoint. As the method is called by the HealthCheckService, it is advised that all timeout restrictions etc are handled by the service instead of the HealthCheck implementation. Implementations might throw an Exception, which should be handled by the HealthCheckService as well. The response indicates if the check was successful, or encountered other problems. If null is returned, the HealthCheckService should consider this as Status.Unknown.
        Specified by:
        perform in interface HealthCheck
        Returns:
        The response indicating the Success/Failure/Timeout/etc of the check
        See Also:
        HealthCheckService