Upgrade Typesafe Config & slf4j

This commit is contained in:
Nafer Sanabria 2017-02-12 16:40:12 -05:00
parent 9e1d6774e5
commit 2c9e013ce5
3 changed files with 20 additions and 14 deletions

View file

@ -18,8 +18,7 @@ import akka.util.Helpers.toRootLowerCase
import scala.annotation.tailrec import scala.annotation.tailrec
import scala.collection.immutable import scala.collection.immutable
import scala.concurrent.duration.Duration import scala.concurrent.{ ExecutionContext, ExecutionContextExecutor, Future, Promise }
import scala.concurrent.{ Await, ExecutionContext, ExecutionContextExecutor, Future, Promise }
import scala.util.{ Failure, Success, Try } import scala.util.{ Failure, Success, Try }
import scala.util.control.{ ControlThrowable, NonFatal } import scala.util.control.{ ControlThrowable, NonFatal }
import java.util.Optional import java.util.Optional
@ -186,14 +185,14 @@ object ActorSystem {
* then tries to walk the stack to find the callers class loader, then falls back to the ClassLoader * then tries to walk the stack to find the callers class loader, then falls back to the ClassLoader
* associated with the ActorSystem class. * associated with the ActorSystem class.
* *
* @see <a href="http://typesafehub.github.io/config/v1.3.0/" target="_blank">The Typesafe Config Library API Documentation</a> * @see <a href="http://typesafehub.github.io/config/v1.3.1/" target="_blank">The Typesafe Config Library API Documentation</a>
*/ */
def create(name: String, config: Config): ActorSystem = apply(name, config) def create(name: String, config: Config): ActorSystem = apply(name, config)
/** /**
* Creates a new ActorSystem with the specified name, the specified Config, and specified ClassLoader * Creates a new ActorSystem with the specified name, the specified Config, and specified ClassLoader
* *
* @see <a href="http://typesafehub.github.io/config/v1.3.0/" target="_blank">The Typesafe Config Library API Documentation</a> * @see <a href="http://typesafehub.github.io/config/v1.3.1/" target="_blank">The Typesafe Config Library API Documentation</a>
*/ */
def create(name: String, config: Config, classLoader: ClassLoader): ActorSystem = apply(name, config, classLoader) def create(name: String, config: Config, classLoader: ClassLoader): ActorSystem = apply(name, config, classLoader)
@ -210,7 +209,7 @@ object ActorSystem {
* executor = "default-executor", including those that have not defined the executor setting and thereby fallback * executor = "default-executor", including those that have not defined the executor setting and thereby fallback
* to the default of "default-dispatcher.executor". * to the default of "default-dispatcher.executor".
* *
* @see <a href="http://typesafehub.github.io/config/v1.3.0/" target="_blank">The Typesafe Config Library API Documentation</a> * @see <a href="http://typesafehub.github.io/config/v1.3.1/" target="_blank">The Typesafe Config Library API Documentation</a>
*/ */
def create(name: String, config: Config, classLoader: ClassLoader, defaultExecutionContext: ExecutionContext): ActorSystem = apply(name, Option(config), Option(classLoader), Option(defaultExecutionContext)) def create(name: String, config: Config, classLoader: ClassLoader, defaultExecutionContext: ExecutionContext): ActorSystem = apply(name, Option(config), Option(classLoader), Option(defaultExecutionContext))
@ -258,14 +257,14 @@ object ActorSystem {
* then tries to walk the stack to find the callers class loader, then falls back to the ClassLoader * then tries to walk the stack to find the callers class loader, then falls back to the ClassLoader
* associated with the ActorSystem class. * associated with the ActorSystem class.
* *
* @see <a href="http://typesafehub.github.io/config/v1.3.0/" target="_blank">The Typesafe Config Library API Documentation</a> * @see <a href="http://typesafehub.github.io/config/v1.3.1/" target="_blank">The Typesafe Config Library API Documentation</a>
*/ */
def apply(name: String, config: Config): ActorSystem = apply(name, Option(config), None, None) def apply(name: String, config: Config): ActorSystem = apply(name, Option(config), None, None)
/** /**
* Creates a new ActorSystem with the specified name, the specified Config, and specified ClassLoader * Creates a new ActorSystem with the specified name, the specified Config, and specified ClassLoader
* *
* @see <a href="http://typesafehub.github.io/config/v1.3.0/" target="_blank">The Typesafe Config Library API Documentation</a> * @see <a href="http://typesafehub.github.io/config/v1.3.1/" target="_blank">The Typesafe Config Library API Documentation</a>
*/ */
def apply(name: String, config: Config, classLoader: ClassLoader): ActorSystem = apply(name, Option(config), Option(classLoader), None) def apply(name: String, config: Config, classLoader: ClassLoader): ActorSystem = apply(name, Option(config), Option(classLoader), None)
@ -278,7 +277,7 @@ object ActorSystem {
* If no ExecutionContext is given, the system will fallback to the executor configured under "akka.actor.default-dispatcher.default-executor.fallback". * If no ExecutionContext is given, the system will fallback to the executor configured under "akka.actor.default-dispatcher.default-executor.fallback".
* The system will use the passed in config, or falls back to the default reference configuration using the ClassLoader. * The system will use the passed in config, or falls back to the default reference configuration using the ClassLoader.
* *
* @see <a href="http://typesafehub.github.io/config/v1.3.0/" target="_blank">The Typesafe Config Library API Documentation</a> * @see <a href="http://typesafehub.github.io/config/v1.3.1/" target="_blank">The Typesafe Config Library API Documentation</a>
*/ */
def apply( def apply(
name: String, name: String,
@ -292,7 +291,7 @@ object ActorSystem {
* *
* For more detailed information about the different possible configuration options, look in the Akka Documentation under "Configuration" * For more detailed information about the different possible configuration options, look in the Akka Documentation under "Configuration"
* *
* @see <a href="http://typesafehub.github.io/config/v1.3.0/" target="_blank">The Typesafe Config Library API Documentation</a> * @see <a href="http://typesafehub.github.io/config/v1.3.1/" target="_blank">The Typesafe Config Library API Documentation</a>
*/ */
class Settings(classLoader: ClassLoader, cfg: Config, final val name: String, val setup: ActorSystemSetup) { class Settings(classLoader: ClassLoader, cfg: Config, final val name: String, val setup: ActorSystemSetup) {
@ -301,7 +300,7 @@ object ActorSystem {
/** /**
* The backing Config of this ActorSystem's Settings * The backing Config of this ActorSystem's Settings
* *
* @see <a href="http://typesafehub.github.io/config/v1.3.0/" target="_blank">The Typesafe Config Library API Documentation</a> * @see <a href="http://typesafehub.github.io/config/v1.3.1/" target="_blank">The Typesafe Config Library API Documentation</a>
*/ */
final val config: Config = { final val config: Config = {
val config = cfg.withFallback(ConfigFactory.defaultReference(classLoader)) val config = cfg.withFallback(ConfigFactory.defaultReference(classLoader))

View file

@ -4,6 +4,7 @@
package akka.dispatch package akka.dispatch
import java.util
import java.util.concurrent.{ ConcurrentHashMap, TimeUnit } import java.util.concurrent.{ ConcurrentHashMap, TimeUnit }
import com.typesafe.config._ import com.typesafe.config._
@ -191,5 +192,10 @@ private[akka] class CachingConfig(_config: Config) extends Config {
def resolveWith(source: Config, options: ConfigResolveOptions) = config.resolveWith(source, options) def resolveWith(source: Config, options: ConfigResolveOptions) = config.resolveWith(source, options)
def resolveWith(source: Config) = config.resolveWith(source) def resolveWith(source: Config) = config.resolveWith(source)
override def getEnumList[T <: Enum[T]](enumClass: Class[T], path: String): util.List[T] = config.getEnumList(enumClass, path)
override def getEnum[T <: Enum[T]](enumClass: Class[T], path: String): T = config.getEnum(enumClass, path)
} }

View file

@ -15,6 +15,7 @@ object Dependencies {
lazy val java8CompatVersion = settingKey[String]("The version of scala-java8-compat to use.") lazy val java8CompatVersion = settingKey[String]("The version of scala-java8-compat to use.")
val junitVersion = "4.12" val junitVersion = "4.12"
val sslConfigVersion = "0.2.1" val sslConfigVersion = "0.2.1"
val slf4jVersion = "1.7.22"
val Versions = Seq( val Versions = Seq(
crossScalaVersions := Seq("2.11.8", "2.12.1"), crossScalaVersions := Seq("2.11.8", "2.12.1"),
@ -39,14 +40,14 @@ object Dependencies {
val camelCore = "org.apache.camel" % "camel-core" % "2.13.4" exclude("org.slf4j", "slf4j-api") // ApacheV2 val camelCore = "org.apache.camel" % "camel-core" % "2.13.4" exclude("org.slf4j", "slf4j-api") // ApacheV2
// when updating config version, update links ActorSystem ScalaDoc to link to the updated version // when updating config version, update links ActorSystem ScalaDoc to link to the updated version
val config = "com.typesafe" % "config" % "1.3.0" // ApacheV2 val config = "com.typesafe" % "config" % "1.3.1" // ApacheV2
val netty = "io.netty" % "netty" % "3.10.6.Final" // ApacheV2 val netty = "io.netty" % "netty" % "3.10.6.Final" // ApacheV2
val scalaStm = Def.setting { "org.scala-stm" %% "scala-stm" % scalaStmVersion.value } // Modified BSD (Scala) val scalaStm = Def.setting { "org.scala-stm" %% "scala-stm" % scalaStmVersion.value } // Modified BSD (Scala)
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.0.5" // Scala License val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.0.5" // Scala License
val scalaReflect = ScalaVersionDependentModuleID.versioned("org.scala-lang" % "scala-reflect" % _) // Scala License val scalaReflect = ScalaVersionDependentModuleID.versioned("org.scala-lang" % "scala-reflect" % _) // Scala License
val slf4jApi = "org.slf4j" % "slf4j-api" % "1.7.16" // MIT val slf4jApi = "org.slf4j" % "slf4j-api" % slf4jVersion // MIT
// mirrored in OSGi sample // mirrored in OSGi sample
val osgiCore = "org.osgi" % "org.osgi.core" % "4.3.1" // ApacheV2 val osgiCore = "org.osgi" % "org.osgi.core" % "4.3.1" // ApacheV2
@ -103,8 +104,8 @@ object Dependencies {
val metricsAll = Seq(metrics, metricsJvm, latencyUtils, hdrHistogram) val metricsAll = Seq(metrics, metricsJvm, latencyUtils, hdrHistogram)
// sigar logging // sigar logging
val slf4jJul = "org.slf4j" % "jul-to-slf4j" % "1.7.16" % "test" // MIT val slf4jJul = "org.slf4j" % "jul-to-slf4j" % slf4jVersion % "test" // MIT
val slf4jLog4j = "org.slf4j" % "log4j-over-slf4j" % "1.7.16" % "test" // MIT val slf4jLog4j = "org.slf4j" % "log4j-over-slf4j" % slf4jVersion % "test" // MIT
// reactive streams tck // reactive streams tck
val reactiveStreamsTck = "org.reactivestreams" % "reactive-streams-tck" % "1.0.0" % "test" // CC0 val reactiveStreamsTck = "org.reactivestreams" % "reactive-streams-tck" % "1.0.0" % "test" // CC0