java.lang.Object
com.aoapps.sql.wrapper.ResultSetWrapperImpl
com.aoapps.sql.tracker.ResultSetTrackerImpl
- All Implemented Interfaces:
OnCloseHandler
,ResultSetTracker
,TrackedArrays
,TrackedBlobs
,TrackedClobs
,TrackedInputStreams
,TrackedNClobs
,TrackedReaders
,TrackedRefs
,TrackedResultSetMetaDatas
,TrackedRowIds
,TrackedSQLXMLs
,ResultSetWrapper
,Wrapper
,AutoCloseable
,ResultSet
,Wrapper
Tracks a
ResultSet
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.Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
-
Constructor Summary
ConstructorDescriptionResultSetTrackerImpl
(ConnectionTrackerImpl connectionTracker, StatementWrapperImpl stmtTracker, ResultSet wrapped) Creates a newResultSet
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.Gets all the meta data 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 ResultSetMetaDataTrackerImpl
wrapResultSetMetaData
(ResultSetMetaData metaData) protected RowIdTrackerImpl
protected SQLXMLTrackerImpl
wrapSQLXML
(SQLXML sqlXml) Methods inherited from class com.aoapps.sql.wrapper.ResultSetWrapperImpl
getArray, getArray, getAsciiStream, getAsciiStream, getBinaryStream, getBinaryStream, getBlob, getBlob, getCharacterStream, getCharacterStream, getClob, getClob, getConnectionWrapper, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getRef, getRef, getRowId, getRowId, getSQLXML, getSQLXML, getStatement, getStatementWrapper, getUnicodeStream, getUnicodeStream, getWrapped, toString, unwrapArray, unwrapBlob, unwrapClob, unwrapInputStream, unwrapNClob, unwrapReader, unwrapRef, unwrapRowId, unwrapSQLXML, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateRef, updateRef, updateRowId, updateRowId, updateSQLXML, updateSQLXML, wrapStatement
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.ResultSetWrapper
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, getWrapped, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, 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
-
ResultSetTrackerImpl
public ResultSetTrackerImpl(ConnectionTrackerImpl connectionTracker, StatementWrapperImpl stmtTracker, ResultSet wrapped) Creates a newResultSet
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:
-
getTrackedResultSetMetaDatas
Description copied from interface:TrackedResultSetMetaDatas
Gets all the meta data that have not yet been closed. Meta datas are assumed to be closed with their result set.- Specified by:
getTrackedResultSetMetaDatas
in interfaceTrackedResultSetMetaDatas
- Returns:
- The mapping from wrapped meta data 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 classResultSetWrapperImpl
-
wrapBlob
- Overrides:
wrapBlob
in classResultSetWrapperImpl
-
wrapClob
- Overrides:
wrapClob
in classResultSetWrapperImpl
-
wrapInputStream
- Overrides:
wrapInputStream
in classResultSetWrapperImpl
-
wrapNClob
- Overrides:
wrapNClob
in classResultSetWrapperImpl
-
wrapReader
- Overrides:
wrapReader
in classResultSetWrapperImpl
-
wrapRef
- Overrides:
wrapRef
in classResultSetWrapperImpl
-
wrapResultSetMetaData
- Overrides:
wrapResultSetMetaData
in classResultSetWrapperImpl
-
wrapRowId
- Overrides:
wrapRowId
in classResultSetWrapperImpl
-
wrapSQLXML
- Overrides:
wrapSQLXML
in classResultSetWrapperImpl
-
close
Calls onClose handlers, closes all tracked objects, then callssuper.close()
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceResultSet
- Specified by:
close
in interfaceResultSetTracker
- Specified by:
close
in interfaceResultSetWrapper
- Throws:
SQLException
- See Also:
-