From c371752b37038bd4427bb1e350e4871688a1342b Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 29 Dec 2011 13:50:54 +0100 Subject: [PATCH] Adding ScalaDoc to EventStream --- akka-actor/src/main/scala/akka/event/EventBus.scala | 2 +- .../src/main/scala/akka/event/EventStream.scala | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/akka-actor/src/main/scala/akka/event/EventBus.scala b/akka-actor/src/main/scala/akka/event/EventBus.scala index f2013b1253..d2cb13b779 100644 --- a/akka-actor/src/main/scala/akka/event/EventBus.scala +++ b/akka-actor/src/main/scala/akka/event/EventBus.scala @@ -116,7 +116,7 @@ trait LookupClassification { this: EventBus ⇒ */ trait SubchannelClassification { this: EventBus ⇒ - implicit val subclassification: Subclassification[Classifier] + protected implicit def subclassification: Subclassification[Classifier] // must be lazy to avoid initialization order problem with subclassification private lazy val subscriptions = new SubclassifiedIndex[Classifier, Subscriber]() diff --git a/akka-actor/src/main/scala/akka/event/EventStream.scala b/akka-actor/src/main/scala/akka/event/EventStream.scala index 5e636593f2..eea9deff35 100644 --- a/akka-actor/src/main/scala/akka/event/EventStream.scala +++ b/akka-actor/src/main/scala/akka/event/EventStream.scala @@ -11,12 +11,21 @@ object EventStream { implicit def fromActorSystem(system: ActorSystem) = system.eventStream } +/** + * An Akka EventStream is a pub-sub stream of events both system and user generated, + * where subscribers are ActorRefs and the channels are Classes and Events are any java.lang.Object. + * EventStreams employ SubchannelClassification, which means that if you listen to a Class, + * you'll receive any message that is of that type or a subtype. + * + * The debug flag in the constructor toggles if operations on this EventStream should also be published + * as Debug-Events + */ class EventStream(private val debug: Boolean = false) extends LoggingBus with SubchannelClassification { type Event = AnyRef type Classifier = Class[_] - val subclassification = new Subclassification[Class[_]] { + protected implicit val subclassification = new Subclassification[Class[_]] { def isEqual(x: Class[_], y: Class[_]) = x == y def isSubclass(x: Class[_], y: Class[_]) = y isAssignableFrom x }