static class StaticCache.LockSafeOutputStream extends FilterOutputStream
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 |
out
Constructor and Description |
---|
StaticCache.LockSafeOutputStream(OutputStream out,
StaticCache.LockEntry lock) |
private final Throwable calledFrom
private ReadWriteLock lock
private String key
private boolean closed
StaticCache.LockSafeOutputStream(OutputStream out, StaticCache.LockEntry lock)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterOutputStream
IOException
protected void finalize() throws Throwable