add pre-shutdown action to be executed inside ChronicleHashCloseOnExitHook.

This is useful when we want to do an orderly shutdown.
For example: To carry out graceful shutdown and explicitly control when a ChronicleHash
is closed, a pre-shutdown action can be a wait on a CountDownLatch that would be released
appropriately.
This commit is contained in:
udaysagar2177
2018-09-21 00:36:04 -07:00
parent ccb6577c3d
commit 9eed0e3265
9 changed files with 105 additions and 11 deletions
@@ -353,6 +353,11 @@ public final class ChronicleSetBuilder<K>
return new SetFromMap<>((VanillaChronicleMap<K, DummyValue, ?>) map);
}
@Override
public void setPreShutdownAction(Runnable preShutdownAction) {
chronicleMapBuilder.setPreShutdownAction(preShutdownAction);
}
/**
* @deprecated don't use private API in the client code
*/