be able to skip automatic closing of a hash resource

This commit is contained in:
udaysagar2177
2019-06-12 19:11:29 -07:00
parent 19ee2d2746
commit 77b678184f
8 changed files with 140 additions and 26 deletions
@@ -181,6 +181,7 @@ public final class ChronicleMapBuilder<K, V> implements
MapEntryOperations<K, V, ?> entryOperations = mapEntryOperations();
MapRemoteOperations<K, V, ?> remoteOperations = mapRemoteOperations();
Runnable preShutdownAction;
boolean skipCloseOnExitHook = false;
private String name;
// not final because of cloning
private ChronicleMapBuilderPrivateAPI<K, V> privateAPI =
@@ -1607,6 +1608,12 @@ public final class ChronicleMapBuilder<K, V> implements
return this;
}
@Override
public ChronicleMapBuilder<K, V> skipCloseOnExitHook(boolean skipCloseOnExitHook) {
this.skipCloseOnExitHook = skipCloseOnExitHook;
return this;
}
@Override
public ChronicleMap<K, V> create() {
// clone() to make this builder instance thread-safe, because createWithoutFile() method