introducing: MainBus feat. LoggingBus
most tests passing, everything compiling, but docs not updated and nasty
thread-leak preventing me from running the whole test-suite (which is
the reason for this commit: I want to chase down that one first).
- the app.mainbus is classified by Class[_] (currently lookup, will
possibly change to sub-class-aware) and accepts AnyRef messages
- LoggingBus handles akka.event-handlers from config specially:
+ start them as system services, supervised by SystemGuardian
+ keep their subscriptions in sync when logLevel_= is called
+ send them InitializeLogger(bus) message before subscribing them (so
they can register for extras like Mute/UnMute)
- two-phased start-up: first phase with actor-less stdout logging, then
subscription of config loggers, then remove stdout logger (logLevels
configurable separately)
- MainBusReaper watches registered receivers and unsubscribes them upon
death (started in phase 2)
- logger factory on Logging object, needs app/bus and log source;
default instance in app.log
This commit is contained in:
parent
c8b17b9e92
commit
f46c6dc533
63 changed files with 749 additions and 643 deletions
|
|
@ -8,7 +8,7 @@ import akka.actor._
|
|||
import akka.actor.DeploymentConfig._
|
||||
import akka.dispatch.Envelope
|
||||
import akka.util.{ ReflectiveAccess, Duration }
|
||||
import akka.event.EventHandler
|
||||
import akka.event.Logging
|
||||
import akka.remote._
|
||||
import RemoteProtocol._
|
||||
import akka.AkkaApplication
|
||||
|
|
@ -28,6 +28,8 @@ import com.eaio.uuid.UUID
|
|||
class ActorSerialization(val app: AkkaApplication, remote: RemoteSupport) {
|
||||
implicit val defaultSerializer = akka.serialization.JavaSerializer // Format.Default
|
||||
|
||||
val log = Logging(app, this)
|
||||
|
||||
val remoteActorSerialization = new RemoteActorSerialization(app, remote)
|
||||
|
||||
def fromBinary[T <: Actor](bytes: Array[Byte], homeAddress: InetSocketAddress): ActorRef =
|
||||
|
|
@ -144,7 +146,7 @@ class ActorSerialization(val app: AkkaApplication, remote: RemoteSupport) {
|
|||
overriddenUuid: Option[UUID],
|
||||
loader: Option[ClassLoader]): ActorRef = {
|
||||
|
||||
app.eventHandler.debug(this, "Deserializing SerializedActorRefProtocol to LocalActorRef:\n%s".format(protocol))
|
||||
log.debug("Deserializing SerializedActorRefProtocol to LocalActorRef:\n{}", protocol)
|
||||
|
||||
// import ReplicationStorageType._
|
||||
// import ReplicationStrategyType._
|
||||
|
|
@ -223,6 +225,8 @@ class ActorSerialization(val app: AkkaApplication, remote: RemoteSupport) {
|
|||
|
||||
class RemoteActorSerialization(val app: AkkaApplication, remote: RemoteSupport) {
|
||||
|
||||
val log = Logging(app, this)
|
||||
|
||||
/**
|
||||
* Deserializes a byte array (Array[Byte]) into an RemoteActorRef instance.
|
||||
*/
|
||||
|
|
@ -239,7 +243,7 @@ class RemoteActorSerialization(val app: AkkaApplication, remote: RemoteSupport)
|
|||
* Deserializes a RemoteActorRefProtocol Protocol Buffers (protobuf) Message into an RemoteActorRef instance.
|
||||
*/
|
||||
private[akka] def fromProtobufToRemoteActorRef(protocol: RemoteActorRefProtocol, loader: Option[ClassLoader]): ActorRef = {
|
||||
app.eventHandler.debug(this, "Deserializing RemoteActorRefProtocol to RemoteActorRef:\n %s".format(protocol))
|
||||
log.debug("Deserializing RemoteActorRefProtocol to RemoteActorRef:\n{}", protocol)
|
||||
|
||||
val ref = RemoteActorRef(
|
||||
remote,
|
||||
|
|
@ -247,7 +251,7 @@ class RemoteActorSerialization(val app: AkkaApplication, remote: RemoteSupport)
|
|||
protocol.getAddress,
|
||||
loader)
|
||||
|
||||
app.eventHandler.debug(this, "Newly deserialized RemoteActorRef has uuid: %s".format(ref.uuid))
|
||||
log.debug("Newly deserialized RemoteActorRef has uuid: {}", ref.uuid)
|
||||
|
||||
ref
|
||||
}
|
||||
|
|
@ -266,7 +270,7 @@ class RemoteActorSerialization(val app: AkkaApplication, remote: RemoteSupport)
|
|||
app.defaultAddress
|
||||
}
|
||||
|
||||
app.eventHandler.debug(this, "Register serialized Actor [%s] as remote @ [%s]".format(actor.uuid, remoteAddress))
|
||||
log.debug("Register serialized Actor [{}] as remote @ [{}]", actor.uuid, remoteAddress)
|
||||
|
||||
RemoteActorRefProtocol.newBuilder
|
||||
.setInetSocketAddress(ByteString.copyFrom(JavaSerializer.toBinary(remoteAddress)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue