java.lang.Object
com.aoapps.sql.wrapper.DriverWrapper
com.aoapps.sql.tracker.DriverTracker
- All Implemented Interfaces:
OnCloseHandler
,Driver
- Direct Known Subclasses:
Driver
Tracks connections obtained from other drivers for unclosed or unfreed
objects.
- Author:
- AO Industries, Inc.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOnClose
(Runnable onCloseHandler) Will call the handler once on close/free.final Map
<Connection, ConnectionTrackerImpl> Gets all the connections that have not yet been closed.protected ConnectionTrackerImpl
newConnectionWrapper
(Connection connection) protected void
Calls onClose handlers, closes all tracked objects, then callssuper.onDeregister()
.Methods inherited from class com.aoapps.sql.wrapper.DriverWrapper
acceptsURL, connect, getDriverMajorVersion, getDriverMinorVersion, getDriverName, getDriverVersion, getMajorVersion, getMinorVersion, getParentLogger, getPropertyInfo, getUrlPrefix, getVersion, jdbcCompliant, toString, toWrappedUrl, toWrapperUrl, wrapConnection
-
Constructor Details
-
DriverTracker
protected DriverTracker()Creates a newDriverTracker
.
-
-
Method Details
-
addOnClose
Description copied from interface:OnCloseHandler
Will call the handler once on close/free.- Specified by:
addOnClose
in interfaceOnCloseHandler
-
getTrackedConnections
Gets all the connections that have not yet been closed.- Returns:
- The mapping from wrapped connection to tracker without any defensive copy.
- See Also:
-
newConnectionWrapper
- Overrides:
newConnectionWrapper
in classDriverWrapper
-
onDeregister
protected void onDeregister()Calls onClose handlers, closes all tracked objects, then callssuper.onDeregister()
.- Overrides:
onDeregister
in classDriverWrapper
- See Also:
-