java.lang.Object
com.aoapps.sql.wrapper.StatementWrapperImpl
com.aoapps.sql.wrapper.PreparedStatementWrapperImpl
com.aoapps.sql.wrapper.CallableStatementWrapperImpl
com.aoapps.sql.tracker.CallableStatementTrackerImpl
- All Implemented Interfaces:
CallableStatementTracker
,OnCloseHandler
,PreparedStatementTracker
,StatementTracker
,TrackedArrays
,TrackedBlobs
,TrackedClobs
,TrackedNClobs
,TrackedParameterMetaDatas
,TrackedReaders
,TrackedRefs
,TrackedResultSetMetaDatas
,TrackedResultSets
,TrackedRowIds
,TrackedSQLXMLs
,CallableStatementWrapper
,PreparedStatementWrapper
,StatementWrapper
,Wrapper
,AutoCloseable
,CallableStatement
,PreparedStatement
,Statement
,Wrapper
public class CallableStatementTrackerImpl
extends CallableStatementWrapperImpl
implements CallableStatementTracker
Tracks a
CallableStatement
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.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
-
Constructor Summary
ConstructorDescriptionCallableStatementTrackerImpl
(ConnectionTrackerImpl connectionTracker, CallableStatement wrapped) Creates a newCallableStatement
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
<NClob, NClobTrackerImpl> Gets all the nclobs that have not yet been freed.Gets all the meta data that have not yet been closed.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
<ResultSet, ResultSetTrackerImpl> Gets all the result sets 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 NClobTrackerImpl
protected ParameterMetaDataTrackerImpl
wrapParameterMetaData
(ParameterMetaData metaData) protected ReaderTracker
wrapReader
(Reader in) protected RefTrackerImpl
protected ResultSetTrackerImpl
wrapResultSet
(ResultSet results) protected ResultSetMetaDataTrackerImpl
wrapResultSetMetaData
(ResultSetMetaData metaData) protected RowIdTrackerImpl
protected SQLXMLTrackerImpl
wrapSQLXML
(SQLXML sqlXml) Methods inherited from class com.aoapps.sql.wrapper.CallableStatementWrapperImpl
getArray, getArray, getBlob, getBlob, getCharacterStream, getCharacterStream, getClob, getClob, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getRef, getRef, getRowId, getRowId, getSQLXML, getSQLXML, getWrapped, setAsciiStream, setAsciiStream, setAsciiStream, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setRowId, setSQLXML
Methods inherited from class com.aoapps.sql.wrapper.PreparedStatementWrapperImpl
executeQuery, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setRef, setRowId, setSQLXML, setUnicodeStream, unwrapArray, unwrapBlob, unwrapClob, unwrapInputStream, unwrapNClob, unwrapReader, unwrapRef, unwrapRowId, unwrapSQLXML
Methods inherited from class com.aoapps.sql.wrapper.StatementWrapperImpl
executeQuery, getConnection, getConnectionWrapper, getGeneratedKeys, getResultSet, 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.CallableStatementWrapper
getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, getWrapped, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, wasNull
Methods inherited from interface com.aoapps.sql.wrapper.PreparedStatementWrapper
addBatch, clearParameters, execute, executeLargeUpdate, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
Methods inherited from interface java.sql.Statement
enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, isSimpleIdentifier
Methods inherited from interface com.aoapps.sql.wrapper.StatementWrapper
addBatch, cancel, clearBatch, clearWarnings, closeOnCompletion, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
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
-
CallableStatementTrackerImpl
public CallableStatementTrackerImpl(ConnectionTrackerImpl connectionTracker, CallableStatement wrapped) Creates a newCallableStatement
tracker.
-
-
Method Details
-
getAllocationStacktrace
-
getAllocationLogger
-
addOnClose
Description copied from interface:OnCloseHandler
Will call the handler once on close/free.- Specified by:
addOnClose
in interfaceOnCloseHandler
-
getTrackedResultSets
Description copied from interface:TrackedResultSets
Gets all the result sets that have not yet been closed.- Specified by:
getTrackedResultSets
in interfaceTrackedResultSets
- Returns:
- The mapping from wrapped result set to tracker without any defensive copy.
- See Also:
-
getTrackedParameterMetaDatas
Description copied from interface:TrackedParameterMetaDatas
Gets all the meta data that have not yet been closed. Meta datas are assumed to be closed with their prepared statement.- Specified by:
getTrackedParameterMetaDatas
in interfaceTrackedParameterMetaDatas
- Returns:
- The mapping from wrapped meta data 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:
-
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:
-
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:
-
wrapResultSet
- Overrides:
wrapResultSet
in classStatementWrapperImpl
- Throws:
SQLException
-
wrapParameterMetaData
- Overrides:
wrapParameterMetaData
in classPreparedStatementWrapperImpl
-
wrapResultSetMetaData
- Overrides:
wrapResultSetMetaData
in classPreparedStatementWrapperImpl
-
wrapArray
- Overrides:
wrapArray
in classCallableStatementWrapperImpl
-
wrapBlob
- Overrides:
wrapBlob
in classCallableStatementWrapperImpl
-
wrapClob
- Overrides:
wrapClob
in classCallableStatementWrapperImpl
-
wrapNClob
- Overrides:
wrapNClob
in classCallableStatementWrapperImpl
-
wrapReader
- Overrides:
wrapReader
in classCallableStatementWrapperImpl
-
wrapRef
- Overrides:
wrapRef
in classCallableStatementWrapperImpl
-
wrapRowId
- Overrides:
wrapRowId
in classCallableStatementWrapperImpl
-
wrapSQLXML
- Overrides:
wrapSQLXML
in classCallableStatementWrapperImpl
-
close
Calls onClose handlers, closes all tracked objects, then callssuper.close()
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceStatement
- Specified by:
close
in interfaceStatementTracker
- Specified by:
close
in interfaceStatementWrapper
- Throws:
SQLException
- See Also:
-