public class CloseableForwardingKVStore extends ForwardingKVStore implements CloseableKVStore
ForwardingKVStore
also implementing CloseableKVStore
, with some associated
underlying Closeable
resource to close when close()
'd.Constructor and Description |
---|
CloseableForwardingKVStore(CloseableKVStore kvstore)
Convenience constructor.
|
CloseableForwardingKVStore(KVStore kvstore)
Constructor for a do-nothing
close() . |
CloseableForwardingKVStore(KVStore kvstore,
Closeable resource)
Primary constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this
KVStore and release any resources associated with it. |
protected KVStore |
delegate()
Get the underlying
KVStore . |
protected void |
finalize()
Ensure the associated resource is
close() 'd before reclaiming memory. |
adjustCounter, apply, decodeCounter, encodeCounter, get, getAtLeast, getAtMost, getRange, put, remove, removeRange
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adjustCounter, apply, decodeCounter, encodeCounter, get, getAtLeast, getAtMost, getRange, getRange, getRange, put, remove, removeRange, removeRange
public CloseableForwardingKVStore(KVStore kvstore)
close()
.
With this constructor, nothing will actually be closed when close()
is invoked.
kvstore
- key/value store for forwardingIllegalArgumentException
- if kvstore
is nullpublic CloseableForwardingKVStore(CloseableKVStore kvstore)
kvstore
- key/value store for forwarding; will be closed on close()
IllegalArgumentException
- if kvstore
is nullpublic CloseableForwardingKVStore(KVStore kvstore, Closeable resource)
kvstore
- key/value store for forwardingresource
- Closeable
resource, or null for noneIllegalArgumentException
- if kvstore
is nullprotected KVStore delegate()
ForwardingKVStore
KVStore
.delegate
in class ForwardingKVStore
KVStore
public void close()
CloseableKVStore
KVStore
and release any resources associated with it.
If this instance is already closed, then nothing happens.
close
in interface CloseableKVStore
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2022. All rights reserved.