I want to load my own config from a configuration file. After loading the config I want to be able to inject the config values using Scaldi. Here is the code where I load the typesafe config. How can I adjust this code so that I can use this module and inject like: val localValue = inject [String] ("property.name")
package somepackage
import java.io.File
import com.typesafe.config.ConfigFactory
import scaldi._
class GlobalModule extends Module {
privateLoadConfig()
private def privateLoadConfig() = {
val c = System.getProperty("jumpmicro.config.path")
val configPath = if (c == null) "jumpmicro.conf" else c
if (configPath != null) {
val f = new File(configPath)
if (f.exists()) {
val config = ConfigFactory.parseFile(f)
// @todo What to do here?
}
}
}
}