Package org.aksw.commons.util.closeable
Class AutoCloseableWithLeakDetectionBase
java.lang.Object
org.aksw.commons.util.closeable.AutoCloseableBase
org.aksw.commons.util.closeable.AutoCloseableWithLeakDetectionBase
- All Implemented Interfaces:
AutoCloseable
A base implementation of AutoClosable that helps detecting resource leaks.
Creation of an instance of this class captures a snapshot of the stack trace.
If finalize is called (typically only by the GC) and there was no prior call to close then
a warning including the stack trace is logged.
Implementing classes need to override
AutoCloseableBase.closeActual() because AutoCloseableBase.close() is final.- Author:
- Claus Stadler
-
Field Summary
FieldsFields inherited from class org.aksw.commons.util.closeable.AutoCloseableBase
closeStackTrace, enableCloseStackTrace, isClosed -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.aksw.commons.util.closeable.AutoCloseableBase
close, closeActual, ensureOpen, throwClosedException
-
Field Details
-
instantiationStackTrace
-
-
Constructor Details
-
AutoCloseableWithLeakDetectionBase
public AutoCloseableWithLeakDetectionBase() -
AutoCloseableWithLeakDetectionBase
public AutoCloseableWithLeakDetectionBase(boolean enableInstantiationStackTrace)
-
-
Method Details