introduce AkkaApplication

- remove global Config
- pull everything which depended on it into new AkkaApplication
- leave EventHandler alone for the moment: that evil sucker gets his
  very own AkkaApplication("akka-reference.conf") until we have settled
  on an acceptable logging API without globals
- make akka-actor and akka-testkit compile
- TestKit uses implicit AkkaApplication passing for maximum convenience
- Actor object nearly completely removed, actor creation possible via
  ActorRefFactory interface which is implemented by AkkaApplication and
  ActorContext
- serialization of ActorRef is probably broken, and so is the reflective
  RemoteSupport (now needs AkkaApplication constructor arg)
- everything else is still broken, including akka-actor-tests, so this
  is of course all not runtime-tested
This commit is contained in:
Roland 2011-10-06 21:19:46 +02:00
parent ccb429df13
commit 2381ec54d0
46 changed files with 734 additions and 1066 deletions

View file

@ -28,16 +28,12 @@ object Scheduler {
private[akka] val service = Executors.newSingleThreadScheduledExecutor(SchedulerThreadFactory)
private def createSendRunnable(receiver: ActorRef, message: Any, throwWhenReceiverExpired: Boolean): Runnable = {
receiver match {
case local: LocalActorRef
val uuid = local.uuid
new Runnable {
def run = Actor.registry.local.actorFor(uuid) match {
case None if (throwWhenReceiverExpired) throw new RuntimeException("Receiver not found, unregistered")
case Some(actor) actor ! message
}
}
case other new Runnable { def run = other ! message }
new Runnable {
def run =
if (receiver.isShutdown && throwWhenReceiverExpired)
throw new RuntimeException("Receiver not found, unregistered")
else
receiver ! message
}
}