java.lang.Object
com.aoapps.sql.wrapper.StatementWrapperImpl
com.aoapps.sql.tracker.StatementTrackerImpl
- All Implemented Interfaces:
OnCloseHandler,StatementTracker,TrackedResultSets,StatementWrapper,Wrapper,AutoCloseable,Statement,Wrapper
Tracks a
Statement 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.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO -
Constructor Summary
ConstructorsConstructorDescriptionStatementTrackerImpl(ConnectionTrackerImpl connectionTracker, Statement wrapped) Creates a newStatementtracker. -
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<ResultSet, ResultSetTrackerImpl> Gets all the result sets that have not yet been closed.protected ResultSetTrackerImplwrapResultSet(ResultSet results) Methods inherited from class com.aoapps.sql.wrapper.StatementWrapperImpl
executeQuery, getConnection, getConnectionWrapper, getGeneratedKeys, getResultSet, getWrapped, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.aoapps.sql.wrapper.StatementWrapper
addBatch, cancel, clearBatch, clearWarnings, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, 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, getWrapped, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeoutMethods 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
-
StatementTrackerImpl
Creates a newStatementtracker.
-
-
Method Details
-
getAllocationStacktrace
-
getAllocationLogger
-
addOnClose
Description copied from interface:OnCloseHandlerWill call the handler once on close/free.- Specified by:
addOnClosein interfaceOnCloseHandler
-
getTrackedResultSets
Description copied from interface:TrackedResultSetsGets all the result sets that have not yet been closed.- Specified by:
getTrackedResultSetsin interfaceTrackedResultSets- Returns:
- The mapping from wrapped result set to tracker without any defensive copy.
- See Also:
-
wrapResultSet
- Overrides:
wrapResultSetin classStatementWrapperImpl- Throws:
SQLException
-
close
Calls onClose handlers, closes all tracked objects, then callssuper.close().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatement- Specified by:
closein interfaceStatementTracker- Specified by:
closein interfaceStatementWrapper- Throws:
SQLException- See Also:
-
