Class StaticCache.LockSafeInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
net.sf.basedb.util.StaticCache.LockSafeInputStream
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
StaticCache

static class StaticCache.LockSafeInputStream
extends FilterInputStream
A lock-safe input stream that releases the associated read lock when the stream is closed.

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.