Added methods for Cluster.remove and Cluster.release that accepts ActorRef

This commit is contained in:
Jonas Bonér 2011-06-22 11:31:01 +02:00
parent 5d4f8b4bcb
commit df8c4dac89
3 changed files with 27 additions and 114 deletions

View file

@ -691,6 +691,13 @@ class DefaultClusterNode private[akka] (
this
} else throw new ClusterException("Not connected to cluster")
/**
* Removes actor from the cluster.
*/
def remove(actorRef: ActorRef) {
remove(actorRef.uuid)
}
/**
* Removes actor with uuid from the cluster.
*/
@ -825,10 +832,20 @@ class DefaultClusterNode private[akka] (
}
}
/**
* Checks in an actor after done using it on this node.
*/
def release(actorRef: ActorRef) {
release(actorRef.address)
}
/**
* Checks in an actor after done using it on this node.
*/
def release(actorAddress: String) {
// FIXME 'Cluster.release' needs to notify all existing ClusterActorRef's that are using the instance that it is no longer available. Then what to do? Should we even remove this method?
isConnected ifOn {
actorUuidsForActorAddress(actorAddress) foreach { uuid
EventHandler.debug(this,