java.lang.Object
com.aoapps.sql.wrapper.SQLXMLWrapperImpl
com.aoapps.sql.tracker.SQLXMLTrackerImpl
- All Implemented Interfaces:
OnCloseHandler
,SQLXMLTracker
,TrackedInputStreams
,TrackedOutputStreams
,TrackedReaders
,TrackedWriters
,SQLXMLWrapper
,Wrapper
,AutoCloseable
,SQLXML
,Wrapper
Tracks a
SQLXML
for unclosed or unfreed objects.- Author:
- AO Industries, Inc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Level
The logging level that enables allocation stack trace logging. -
Constructor Summary
ConstructorsConstructorDescriptionSQLXMLTrackerImpl
(ConnectionTrackerImpl connectionTracker, SQLXML wrapped) Creates a newSQLXML
tracker. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOnClose
(Runnable onCloseHandler) Will call the handler once on close/free.void
free()
Calls onClose handlers, closes all tracked objects, then callssuper.free()
.final Map
<InputStream, InputStreamTracker> Gets all the input streams that have not yet been closed.final Map
<OutputStream, OutputStreamTracker> Gets all the output streams that have not yet been closed.final Map
<Reader, ReaderTracker> Gets all the readers that have not yet been closed.final Map
<Writer, WriterTracker> Gets all the writers that have not yet been closed.protected InputStreamTracker
protected OutputStreamTracker
protected ReaderTracker
wrapReader
(Reader in) protected WriterTracker
wrapWriter
(Writer out) Methods inherited from class com.aoapps.sql.wrapper.SQLXMLWrapperImpl
getBinaryStream, getCharacterStream, getConnectionWrapper, getWrapped, setBinaryStream, setCharacterStream, 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.SQLXMLWrapper
close, getBinaryStream, getCharacterStream, getSource, getString, getWrapped, setBinaryStream, setCharacterStream, setResult, setString
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
-
SQLXMLTrackerImpl
Creates a newSQLXML
tracker.
-
-
Method Details
-
getAllocationStacktrace
-
getAllocationLogger
-
addOnClose
Description copied from interface:OnCloseHandler
Will call the handler once on close/free.- Specified by:
addOnClose
in interfaceOnCloseHandler
-
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:
-
getTrackedOutputStreams
Description copied from interface:TrackedOutputStreams
Gets all the output streams that have not yet been closed.- Specified by:
getTrackedOutputStreams
in interfaceTrackedOutputStreams
- Returns:
- The mapping from wrapped output stream 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:
-
getTrackedWriters
Description copied from interface:TrackedWriters
Gets all the writers that have not yet been closed.- Specified by:
getTrackedWriters
in interfaceTrackedWriters
- Returns:
- The mapping from wrapped writer to tracker without any defensive copy.
- See Also:
-
wrapInputStream
- Overrides:
wrapInputStream
in classSQLXMLWrapperImpl
-
wrapOutputStream
- Overrides:
wrapOutputStream
in classSQLXMLWrapperImpl
-
wrapReader
- Overrides:
wrapReader
in classSQLXMLWrapperImpl
-
wrapWriter
- Overrides:
wrapWriter
in classSQLXMLWrapperImpl
-
free
Calls onClose handlers, closes all tracked objects, then callssuper.free()
.- Specified by:
free
in interfaceSQLXML
- Specified by:
free
in interfaceSQLXMLTracker
- Specified by:
free
in interfaceSQLXMLWrapper
- Throws:
SQLException
- See Also:
-