Package oracle.jdbc.diagnostics
Class CommonDiagnosable
- java.lang.Object
-
- oracle.jdbc.diagnostics.AbstractDiagnosable
-
- oracle.jdbc.diagnostics.CommonDiagnosable
-
- All Implemented Interfaces:
Diagnosable,PropertyChangeListener
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 {
-
-
Field Summary
-
Fields inherited from class oracle.jdbc.diagnostics.AbstractDiagnosable
diagnostic, IS_VALID_BOOLEAN_STRING, IS_VALID_BUFFER_SIZE, IS_VALID_LOGGER_NAME
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDiagnosticLoggerName()static DiagnosablegetInstance()Returns the singleton instance of common diagnosable.protected TraceAttributesgetTraceAttributes()booleanisDebugEnabled()Returns true if debug is enabled.booleanisDiagnoseFirstFailureEnabled()Returns true if Diagnose First Failure is enabled.protected booleanisSensitivePermitted()voidpropertyChange(PropertyChangeEvent event)This method gets called when a MBean operation is invoked.voidsetDebugEnabled(boolean enabled)voidsetDiagnoseFirstFailureEnabled(boolean enabled)-
Methods inherited from class oracle.jdbc.diagnostics.AbstractDiagnosable
abstractPropertyChange, begin, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debugp, enableDiagnoseFirstFailureDump, enableGlobalDebug, enableMetrics, enableWriteLogsToDiagnoseFirstFailure, end, getSystemProperty, isGlobalDebugEnabled, isLoggable, isMetricsEnabled, isSensitiveEnabled, isWriteLogsToDiagnoseFirstFailureEnabled, onClose, onConfigFileChange, resumeLogging, secure, setSensitiveEnabled, suspendLogging, trace, tracep
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface oracle.jdbc.diagnostics.Diagnosable
beginCurrentSql, endCurrentSql, format, getDiagnosable
-
-
-
-
Method Detail
-
getInstance
public static Diagnosable getInstance()
Returns the singleton instance of common diagnosable.- Returns:
- singleton common diagnosable instance
-
setDebugEnabled
public final void setDebugEnabled(boolean enabled)
- Specified by:
setDebugEnabledin classAbstractDiagnosable
-
setDiagnoseFirstFailureEnabled
public final void setDiagnoseFirstFailureEnabled(boolean enabled)
- Specified by:
setDiagnoseFirstFailureEnabledin classAbstractDiagnosable
-
isSensitivePermitted
protected boolean isSensitivePermitted()
- Specified by:
isSensitivePermittedin classAbstractDiagnosable
-
getDiagnosticLoggerName
public java.lang.String getDiagnosticLoggerName()
- Specified by:
getDiagnosticLoggerNamein classAbstractDiagnosable
-
getTraceAttributes
protected TraceAttributes getTraceAttributes()
- Specified by:
getTraceAttributesin classAbstractDiagnosable
-
propertyChange
public void propertyChange(PropertyChangeEvent event)
Description copied from interface:DiagnosableThis 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:DiagnosableReturns true if debug is enabled.- Returns:
- true if debug is enabled.
-
isDiagnoseFirstFailureEnabled
public final boolean isDiagnoseFirstFailureEnabled()
Description copied from interface:DiagnosableReturns true if Diagnose First Failure is enabled.- Returns:
- true if Diagnose First Failure is enabled.
-
-