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
FieldsModifier and TypeFieldDescriptionstatic final LevelThe 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
ConstructorsConstructorDescriptionResultSetTrackerImpl(ConnectionTrackerImpl connectionTracker, StatementWrapperImpl stmtTracker, ResultSet wrapped) Creates a newResultSettracker. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOnClose(Runnable onCloseHandler) Will call the handler once on close/free.voidclose()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 ArrayTrackerImplprotected BlobTrackerImplprotected ClobTrackerImplprotected InputStreamTrackerprotected NClobTrackerImplprotected ReaderTrackerwrapReader(Reader in) protected RefTrackerImplprotected ResultSetMetaDataTrackerImplwrapResultSetMetaData(ResultSetMetaData metaData) protected RowIdTrackerImplprotected SQLXMLTrackerImplwrapSQLXML(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, wrapStatementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, wasNullMethods 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 newResultSettracker.
-
-
Method Details
-
getAllocationStacktrace
-
getAllocationLogger
-
addOnClose
Description copied from interface:OnCloseHandlerWill call the handler once on close/free.- Specified by:
addOnClosein interfaceOnCloseHandler
-
getTrackedArrays
Description copied from interface:TrackedArraysGets all the arrays that have not yet been freed.- Specified by:
getTrackedArraysin interfaceTrackedArrays- Returns:
- The mapping from wrapped array to tracker without any defensive copy.
- See Also:
-
getTrackedBlobs
Description copied from interface:TrackedBlobsGets all the blobs that have not yet been freed.- Specified by:
getTrackedBlobsin interfaceTrackedBlobs- Returns:
- The mapping from wrapped blob to tracker without any defensive copy.
- See Also:
-
getTrackedClobs
Description copied from interface:TrackedClobsGets all the clobs that have not yet been freed. This only containsClob, please see other method forNClob.- Specified by:
getTrackedClobsin interfaceTrackedClobs- Returns:
- The mapping from wrapped clob to tracker without any defensive copy.
- See Also:
-
getTrackedInputStreams
Description copied from interface:TrackedInputStreamsGets all the input streams that have not yet been closed.- Specified by:
getTrackedInputStreamsin interfaceTrackedInputStreams- Returns:
- The mapping from wrapped input stream to tracker without any defensive copy.
- See Also:
-
getTrackedNClobs
Description copied from interface:TrackedNClobsGets all the nclobs that have not yet been freed.- Specified by:
getTrackedNClobsin interfaceTrackedNClobs- Returns:
- The mapping from wrapped nclob to tracker without any defensive copy.
- See Also:
-
getTrackedReaders
Description copied from interface:TrackedReadersGets all the readers that have not yet been closed.- Specified by:
getTrackedReadersin interfaceTrackedReaders- Returns:
- The mapping from wrapped reader to tracker without any defensive copy.
- See Also:
-
getTrackedRefs
Description copied from interface:TrackedRefsGets all the refs that have not yet been closed. Refs are assumed to be closed with their connection.- Specified by:
getTrackedRefsin interfaceTrackedRefs- Returns:
- The mapping from wrapped ref to tracker without any defensive copy.
- See Also:
-
getTrackedResultSetMetaDatas
Description copied from interface:TrackedResultSetMetaDatasGets all the meta data that have not yet been closed. Meta datas are assumed to be closed with their result set.- Specified by:
getTrackedResultSetMetaDatasin interfaceTrackedResultSetMetaDatas- Returns:
- The mapping from wrapped meta data to tracker without any defensive copy.
- See Also:
-
getTrackedRowIds
Description copied from interface:TrackedRowIdsGets all the row IDs that have not yet been closed. Row IDs are assumed to be closed with their connection.- Specified by:
getTrackedRowIdsin interfaceTrackedRowIds- Returns:
- The mapping from wrapped row ID to tracker without any defensive copy.
- See Also:
-
getTrackedSQLXMLs
Description copied from interface:TrackedSQLXMLsGets all the SQL XMLs that have not yet been freed.- Specified by:
getTrackedSQLXMLsin interfaceTrackedSQLXMLs- Returns:
- The mapping from wrapped SQL XML to tracker without any defensive copy.
- See Also:
-
wrapArray
- Overrides:
wrapArrayin classResultSetWrapperImpl
-
wrapBlob
- Overrides:
wrapBlobin classResultSetWrapperImpl
-
wrapClob
- Overrides:
wrapClobin classResultSetWrapperImpl
-
wrapInputStream
- Overrides:
wrapInputStreamin classResultSetWrapperImpl
-
wrapNClob
- Overrides:
wrapNClobin classResultSetWrapperImpl
-
wrapReader
- Overrides:
wrapReaderin classResultSetWrapperImpl
-
wrapRef
- Overrides:
wrapRefin classResultSetWrapperImpl
-
wrapResultSetMetaData
- Overrides:
wrapResultSetMetaDatain classResultSetWrapperImpl
-
wrapRowId
- Overrides:
wrapRowIdin classResultSetWrapperImpl
-
wrapSQLXML
- Overrides:
wrapSQLXMLin classResultSetWrapperImpl
-
close
Calls onClose handlers, closes all tracked objects, then callssuper.close().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceResultSet- Specified by:
closein interfaceResultSetTracker- Specified by:
closein interfaceResultSetWrapper- Throws:
SQLException- See Also:
-
