ModuleConfig
cc.otavia.core.config.ModuleConfig
trait ModuleConfig
SPI trait for module-specific configuration.
Modules (handler, codec-, sql-, etc.) can define their own configuration by implementing this trait and registering the config instance with OtaviaConfigBuilder.withModuleConfig. The config system stores module configs by Class key for type-safe retrieval.
Example:
// In handler module:
case class SslConfig(cacheBufferSize: Int = 20480) extends ModuleConfig:
override def propertyPrefix: String = "cc.otavia.handler.ssl"
// Registration:
val config = OtaviaConfigBuilder()
.withModuleConfig(SslConfig(cacheBufferSize = 32768))
.build()
// Retrieval:
val sslCfg = system.config.getModuleConfig(classOf[SslConfig])
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class SslConfig
Members list
In this article