Class CommonDiagnosable

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener, Diagnosable

    public final class CommonDiagnosable
    extends AbstractDiagnosable
    This is a common diagnosable class for all those JDBC classes that are not tied to a particular connection, all such classes should use this common diagnosable for logging.

    These classes should implement Diagnosable interface and override its getDiagnosable() method which should return an instance of this class. This is a singleton class which means all classes using common diagnosable share same diagnosable instance.

    Below example shows how to use this Common Diagnosable for logging:
      {@code
        class XYZ implements Diagnosable {
    • Method Detail

      • getInstance

        public static Diagnosable getInstance()
        Returns the singleton instance of common diagnosable.
        Returns:
        singleton common diagnosable instance
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent event)
        Description copied from interface: Diagnosable
        This method gets called when a MBean operation is invoked.
        Parameters:
        event - A PropertyChangeEvent object describing the event source and the property that has changed.
      • isDebugEnabled

        public final boolean isDebugEnabled()
        Description copied from interface: Diagnosable
        Returns true if debug is enabled.
        Returns:
        true if debug is enabled.
      • isDiagnoseFirstFailureEnabled

        public final boolean isDiagnoseFirstFailureEnabled()
        Description copied from interface: Diagnosable
        Returns true if Diagnose First Failure is enabled.
        Returns:
        true if Diagnose First Failure is enabled.