java.lang.Object
com.aoapps.sql.wrapper.BlobWrapperImpl
com.aoapps.sql.tracker.BlobTrackerImpl
- All Implemented Interfaces:
BlobTracker
,OnCloseHandler
,TrackedInputStreams
,TrackedOutputStreams
,BlobWrapper
,Wrapper
,AutoCloseable
,Blob
,Wrapper
Tracks a
Blob
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. -
Constructor Summary
ConstructorDescriptionBlobTrackerImpl
(ConnectionTrackerImpl connectionTracker, Blob wrapped) Creates a newBlob
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.protected InputStreamTracker
protected OutputStreamTracker
Methods inherited from class com.aoapps.sql.wrapper.BlobWrapperImpl
getBinaryStream, getBinaryStream, getConnectionWrapper, getWrapped, position, setBinaryStream, toString, unwrapBlob
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.BlobWrapper
close, getBinaryStream, getBinaryStream, getBytes, getWrapped, length, position, position, setBinaryStream, setBytes, setBytes, truncate
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
-
BlobTrackerImpl
Creates a newBlob
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:
-
wrapInputStream
- Overrides:
wrapInputStream
in classBlobWrapperImpl
-
wrapOutputStream
- Overrides:
wrapOutputStream
in classBlobWrapperImpl
-
free
Calls onClose handlers, closes all tracked objects, then callssuper.free()
.- Specified by:
free
in interfaceBlob
- Specified by:
free
in interfaceBlobTracker
- Specified by:
free
in interfaceBlobWrapper
- Throws:
SQLException
- See Also:
-