java.lang.Object
com.aoapps.sql.wrapper.SQLInputWrapperImpl
com.aoapps.sql.tracker.SQLInputTrackerImpl
- All Implemented Interfaces:
OnCloseHandler
,SQLInputTracker
,TrackedArrays
,TrackedBlobs
,TrackedClobs
,TrackedInputStreams
,TrackedNClobs
,TrackedReaders
,TrackedRefs
,TrackedRowIds
,TrackedSQLXMLs
,SQLInputWrapper
,Wrapper
,AutoCloseable
,SQLInput
,Wrapper
Tracks a
SQLInput
for unclosed or unfreed objects.- Author:
- AO Industries, Inc.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Level
The logging level that enables allocation stack trace logging. -
Constructor Summary
ConstructorDescriptionSQLInputTrackerImpl
(ConnectionTrackerImpl connectionTracker, SQLInput wrapped) Creates a newSQLInput
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
<Array, ArrayTrackerImpl> Gets all the arrays that have not yet been freed.final Map
<Blob, BlobTrackerImpl> Gets all the blobs that have not yet been freed.final Map
<Clob, ClobTrackerImpl> Gets all the clobs that have not yet been freed.final Map
<InputStream, InputStreamTracker> Gets all the input streams that have not yet been closed.final Map
<NClob, NClobTrackerImpl> Gets all the nclobs that have not yet been freed.final Map
<Reader, ReaderTracker> Gets all the readers that have not yet been closed.final Map
<Ref, RefTrackerImpl> Gets all the refs that have not yet been closed.final Map
<RowId, RowIdTrackerImpl> Gets all the row IDs that have not yet been closed.final Map
<SQLXML, SQLXMLTrackerImpl> Gets all the SQL XMLs that have not yet been freed.protected ArrayTrackerImpl
protected BlobTrackerImpl
protected ClobTrackerImpl
protected InputStreamTracker
protected NClobTrackerImpl
protected ReaderTracker
wrapReader
(Reader in) protected RefTrackerImpl
protected RowIdTrackerImpl
protected SQLXMLTrackerImpl
wrapSQLXML
(SQLXML sqlXml) Methods inherited from class com.aoapps.sql.wrapper.SQLInputWrapperImpl
getConnectionWrapper, getWrapped, readArray, readAsciiStream, readBinaryStream, readBlob, readCharacterStream, readClob, readNClob, readRef, readRowId, readSQLXML, toString
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.SQLInputWrapper
getWrapped, readArray, readAsciiStream, readBigDecimal, readBinaryStream, readBlob, readBoolean, readByte, readBytes, readCharacterStream, readClob, readDate, readDouble, readFloat, readInt, readLong, readNClob, readNString, readObject, readObject, readRef, readRowId, readShort, readSQLXML, readString, readTime, readTimestamp, readURL, wasNull
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
-
SQLInputTrackerImpl
Creates a newSQLInput
tracker.
-
-
Method Details
-
getAllocationStacktrace
-
getAllocationLogger
-
addOnClose
Description copied from interface:OnCloseHandler
Will call the handler once on close/free.- Specified by:
addOnClose
in interfaceOnCloseHandler
-
getTrackedArrays
Description copied from interface:TrackedArrays
Gets all the arrays that have not yet been freed.- Specified by:
getTrackedArrays
in interfaceTrackedArrays
- Returns:
- The mapping from wrapped array to tracker without any defensive copy.
- See Also:
-
getTrackedBlobs
Description copied from interface:TrackedBlobs
Gets all the blobs that have not yet been freed.- Specified by:
getTrackedBlobs
in interfaceTrackedBlobs
- Returns:
- The mapping from wrapped blob to tracker without any defensive copy.
- See Also:
-
getTrackedClobs
Description copied from interface:TrackedClobs
Gets all the clobs that have not yet been freed. This only containsClob
, please see other method forNClob
.- Specified by:
getTrackedClobs
in interfaceTrackedClobs
- Returns:
- The mapping from wrapped clob to tracker without any defensive copy.
- See Also:
-
getTrackedInputStreams
Description copied from interface:TrackedInputStreams
Gets all the input streams that have not yet been closed.- Specified by:
getTrackedInputStreams
in interfaceTrackedInputStreams
- Returns:
- The mapping from wrapped input stream to tracker without any defensive copy.
- See Also:
-
getTrackedNClobs
Description copied from interface:TrackedNClobs
Gets all the nclobs that have not yet been freed.- Specified by:
getTrackedNClobs
in interfaceTrackedNClobs
- Returns:
- The mapping from wrapped nclob to tracker without any defensive copy.
- See Also:
-
getTrackedReaders
Description copied from interface:TrackedReaders
Gets all the readers that have not yet been closed.- Specified by:
getTrackedReaders
in interfaceTrackedReaders
- Returns:
- The mapping from wrapped reader to tracker without any defensive copy.
- See Also:
-
getTrackedRefs
Description copied from interface:TrackedRefs
Gets all the refs that have not yet been closed. Refs are assumed to be closed with their connection.- Specified by:
getTrackedRefs
in interfaceTrackedRefs
- Returns:
- The mapping from wrapped ref to tracker without any defensive copy.
- See Also:
-
getTrackedRowIds
Description copied from interface:TrackedRowIds
Gets all the row IDs that have not yet been closed. Row IDs are assumed to be closed with their connection.- Specified by:
getTrackedRowIds
in interfaceTrackedRowIds
- Returns:
- The mapping from wrapped row ID to tracker without any defensive copy.
- See Also:
-
getTrackedSQLXMLs
Description copied from interface:TrackedSQLXMLs
Gets all the SQL XMLs that have not yet been freed.- Specified by:
getTrackedSQLXMLs
in interfaceTrackedSQLXMLs
- Returns:
- The mapping from wrapped SQL XML to tracker without any defensive copy.
- See Also:
-
wrapArray
- Overrides:
wrapArray
in classSQLInputWrapperImpl
-
wrapBlob
- Overrides:
wrapBlob
in classSQLInputWrapperImpl
-
wrapClob
- Overrides:
wrapClob
in classSQLInputWrapperImpl
-
wrapInputStream
- Overrides:
wrapInputStream
in classSQLInputWrapperImpl
-
wrapNClob
- Overrides:
wrapNClob
in classSQLInputWrapperImpl
-
wrapReader
- Overrides:
wrapReader
in classSQLInputWrapperImpl
-
wrapRef
- Overrides:
wrapRef
in classSQLInputWrapperImpl
-
wrapRowId
- Overrides:
wrapRowId
in classSQLInputWrapperImpl
-
wrapSQLXML
- Overrides:
wrapSQLXML
in classSQLInputWrapperImpl
-
close
Calls onClose handlers, closes all tracked objects, then callssuper.close()
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSQLInputTracker
- Specified by:
close
in interfaceSQLInputWrapper
- Throws:
SQLException
- See Also:
-