diff --git a/akka-actor/src/main/scala/akka/cluster/ClusterInterface.scala b/akka-actor/src/main/scala/akka/cluster/ClusterInterface.scala index a43f80578c..e848529a94 100644 --- a/akka-actor/src/main/scala/akka/cluster/ClusterInterface.scala +++ b/akka-actor/src/main/scala/akka/cluster/ClusterInterface.scala @@ -129,6 +129,8 @@ trait ClusterNode { def remoteServerAddress: InetSocketAddress + def start() + def shutdown() def isShutdown: Boolean @@ -298,6 +300,11 @@ trait ClusterNode { */ def isInUseOnNode(actorAddress: String): Boolean + /** + * Is the actor with uuid in use or not? + */ + def isInUseOnNode(actorAddress: String, nodeName: String): Boolean + /** * Is the actor with uuid in use or not? */ @@ -465,7 +472,7 @@ trait ClusterNode { */ private[cluster] def uuidsForActorsInUseOnNode(nodeName: String): Array[UUID] - private[cluster] def initializeNode() + private[cluster] def boot() private[cluster] def publish(change: ChangeNotification) diff --git a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala index c79d68af35..45323b880e 100644 --- a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala +++ b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala @@ -378,13 +378,13 @@ class DefaultClusterNode private[akka] ( if (enableJMX) createMBean - initializeNode() + boot() // ======================================= // Node // ======================================= - private[cluster] def initializeNode() { + private[cluster] def boot() { EventHandler.info(this, ("\nCreating cluster node with" + "\n\tcluster name = [%s]" + @@ -404,6 +404,8 @@ class DefaultClusterNode private[akka] ( def isShutdown = isShutdownFlag.get + def start() {} + def shutdown() { isShutdownFlag.set(true) @@ -715,6 +717,11 @@ class DefaultClusterNode private[akka] ( */ def isInUseOnNode(actorAddress: String, node: NodeAddress): Boolean = zkClient.exists(actorAddressToNodesPathFor(actorAddress, node.nodeName)) + /** + * Is the actor with uuid in use or not? + */ + def isInUseOnNode(actorAddress: String, nodeName: String): Boolean = zkClient.exists(actorAddressToNodesPathFor(actorAddress, nodeName)) + /** * Checks out an actor for use on this node, e.g. checked out as a 'LocalActorRef' but it makes it available * for remote access through lookup by its UUID. @@ -1665,7 +1672,7 @@ class StateListener(self: ClusterNode) extends IZkStateListener { */ def handleNewSession() { EventHandler.debug(this, "Session expired re-initializing node [%s]".format(self.nodeAddress)) - self.initializeNode() + self.boot() self.publish(NewSession) } }