java.lang.Object
com.aoapps.sql.wrapper.SQLDataWrapperImpl
com.aoapps.sql.tracker.SQLDataTrackerImpl
- All Implemented Interfaces:
OnCloseHandler
,SQLDataTracker
,TrackedSQLInputs
,TrackedSQLOutputs
,SQLDataWrapper
,Wrapper
,AutoCloseable
,SQLData
,Wrapper
Tracks a
SQLData
for unclosed or unfreed objects.- Author:
- AO Industries, Inc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Level
The logging level that enables allocation stack trace logging. -
Constructor Summary
ConstructorsConstructorDescriptionSQLDataTrackerImpl
(ConnectionTrackerImpl connectionTracker, SQLData wrapped) Creates a newSQLData
tracker. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOnClose
(Runnable onCloseHandler) Will call the handler once on close/free.void
close()
Calls onClose handlers, closes all tracked objects, then callssuper.close()
.final Map
<SQLInput, SQLInputTrackerImpl> Gets all the SQL inputs that have not yet been closed.final Map
<SQLOutput, SQLOutputTrackerImpl> Gets all the SQL outputs that have not yet been closed.protected SQLInputWrapperImpl
wrapSQLInput
(SQLInput sqlInput) protected SQLOutputWrapperImpl
wrapSQLOutput
(SQLOutput sqlOutput) Methods inherited from class com.aoapps.sql.wrapper.SQLDataWrapperImpl
getConnectionWrapper, getWrapped, readSQL, toString, writeSQL
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.aoapps.sql.wrapper.SQLDataWrapper
getSQLTypeName, getWrapped, readSQL, writeSQL
Methods inherited from interface com.aoapps.sql.wrapper.Wrapper
isWrapperFor, unwrap
-
Field Details
-
ALLOCATION_STACKTRACE_LOG_LEVEL
The logging level that enables allocation stack trace logging.
-
-
Constructor Details
-
SQLDataTrackerImpl
Creates a newSQLData
tracker.
-
-
Method Details
-
getAllocationStacktrace
-
getAllocationLogger
-
addOnClose
Description copied from interface:OnCloseHandler
Will call the handler once on close/free.- Specified by:
addOnClose
in interfaceOnCloseHandler
-
getTrackedSQLInputs
Description copied from interface:TrackedSQLInputs
Gets all the SQL inputs that have not yet been closed.- Specified by:
getTrackedSQLInputs
in interfaceTrackedSQLInputs
- Returns:
- The mapping from wrapped SQL input to tracker without any defensive copy.
- See Also:
-
getTrackedSQLOutputs
Description copied from interface:TrackedSQLOutputs
Gets all the SQL outputs that have not yet been closed.- Specified by:
getTrackedSQLOutputs
in interfaceTrackedSQLOutputs
- Returns:
- The mapping from wrapped SQL output to tracker without any defensive copy.
- See Also:
-
wrapSQLInput
- Overrides:
wrapSQLInput
in classSQLDataWrapperImpl
-
wrapSQLOutput
- Overrides:
wrapSQLOutput
in classSQLDataWrapperImpl
-
close
Calls onClose handlers, closes all tracked objects, then callssuper.close()
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSQLDataTracker
- Specified by:
close
in interfaceSQLDataWrapper
- Throws:
SQLException
- See Also:
-