Removed the ActorRegistry, the different ActorRefProvider implementations now holds an Address->ActorRef registry. Looking up by UUID is gone together with all the other lookup methods such as 'foreach' etc. which do not make sense in a distributed env. 'shutdownAll' is also removed but will be replaced by parental supervision.

This commit is contained in:
Jonas Bonér 2011-10-07 19:42:10 +02:00
parent 114abe19bd
commit 3e6decffc0
23 changed files with 208 additions and 507 deletions

View file

@ -32,6 +32,7 @@ class RemoteActorRefProvider extends ActorRefProvider {
import akka.dispatch.Promise
private val actors = new ConcurrentHashMap[String, Promise[Option[ActorRef]]]
private val remoteDaemonConnectionManager = new RemoteConnectionManager(failureDetector = new BannagePeriodFailureDetector(60 seconds)) // FIXME make timeout configurable
def actorOf(props: Props, address: String): Option[ActorRef] = {
@ -119,7 +120,7 @@ class RemoteActorRefProvider extends ActorRefProvider {
throw e
}
actor foreach Actor.registry.register // only for ActorRegistry backward compat, will be removed later
// actor foreach Actor.registry.register // only for ActorRegistry backward compat, will be removed later
newFuture completeWithResult actor
actor
@ -129,7 +130,10 @@ class RemoteActorRefProvider extends ActorRefProvider {
}
}
def findActorRef(address: String): Option[ActorRef] = throw new UnsupportedOperationException
def actorFor(address: String): Option[ActorRef] = actors.get(address) match {
case null None
case future future.await.resultOrException.getOrElse(None)
}
/**
* Returns true if the actor was in the provider's cache and evicted successfully, else false.