From 80c4ed6fccec4dbe59697381a21ff7d44725de4d Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 25 Sep 2020 14:51:16 +0200 Subject: [PATCH] Endpoint custom settingsStore can now be created (instead of just specifying a type) --- src/dorkbox/network/connection/EndPoint.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/dorkbox/network/connection/EndPoint.kt b/src/dorkbox/network/connection/EndPoint.kt index fc046329..68a2cbe5 100644 --- a/src/dorkbox/network/connection/EndPoint.kt +++ b/src/dorkbox/network/connection/EndPoint.kt @@ -128,7 +128,7 @@ internal constructor(val type: Class<*>, internal val config: Configuration) : A handshakeKryo = serialization.initHandshakeKryo() // we have to be able to specify the property store - settingsStore = config.settingsStore.create(logger) + settingsStore = createSettingsStore(logger) crypto = CryptoManagement(logger, settingsStore, type, config) @@ -172,6 +172,14 @@ internal constructor(val type: Class<*>, internal val config: Configuration) : A } } + /** + * Open so users can override which/how a settings store is created + */ + open fun createSettingsStore(logger: KLogger): SettingsStore { + return config.settingsStore.create(logger) + } + + internal fun initEndpointState(): Aeron { shutdown.getAndSet(false) shutdownWaiter = SuspendWaiter()