static class StaticCache.LockSafeInputStream extends FilterInputStream
NOTE! It is important that we keep a strong reference to the 'key' in this class until the stream is closed, since otherwise the locked entry may be reclaimed by the garbage collector.
Modifier and Type | Field and Description |
---|---|
private Throwable |
calledFrom |
private boolean |
closed |
private String |
key |
private ReadWriteLock |
lock |
in
Constructor and Description |
---|
StaticCache.LockSafeInputStream(InputStream in,
StaticCache.LockEntry lock) |
private final Throwable calledFrom
private ReadWriteLock lock
private String key
private boolean closed
StaticCache.LockSafeInputStream(InputStream in, StaticCache.LockEntry lock)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterInputStream
IOException
protected void finalize() throws Throwable