From 30a91e935445d764d58d9e329236e9696264eeff Mon Sep 17 00:00:00 2001 From: Ivan Topolnjak Date: Fri, 30 Jan 2015 03:25:54 +0100 Subject: + all: use ModuleSupervisor init all auto-start modules. The new ModuleSupervisor implementation will make use of special configuration keys under the `kamon.modules` section to detect all the available modules in the classpath and do two things with that info: 1. Log the AspectJ Weaver missing error if any of the available modules requires AspectJ. 2. Start all available modules that are marked with the auto-start setting. --- kamon-core/src/main/scala/kamon/Kamon.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'kamon-core/src/main/scala/kamon/Kamon.scala') diff --git a/kamon-core/src/main/scala/kamon/Kamon.scala b/kamon-core/src/main/scala/kamon/Kamon.scala index d29061f8..6fedc065 100644 --- a/kamon-core/src/main/scala/kamon/Kamon.scala +++ b/kamon-core/src/main/scala/kamon/Kamon.scala @@ -18,6 +18,7 @@ import _root_.akka.actor import _root_.akka.actor._ import com.typesafe.config.Config import kamon.metric._ +import kamon.supervisor.ModuleSupervisor import kamon.trace.{ Tracer, TracerExtension } class Kamon(val actorSystem: ActorSystem) { @@ -25,7 +26,10 @@ class Kamon(val actorSystem: ActorSystem) { val tracer: TracerExtension = Tracer.get(actorSystem) val userMetrics: UserMetricsExtension = UserMetrics.get(actorSystem) - def shutdown: Unit = + // This will cause all auto-start modules to initiate. + ModuleSupervisor.get(actorSystem) + + def shutdown(): Unit = actorSystem.shutdown() } -- cgit v1.2.3