diff --git a/.gitignore b/.gitignore index d47c97002e..a11c2f1e00 100755 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ akka-docs/_build/ akka-tutorials/akka-tutorial-first/project/boot/ akka-tutorials/akka-tutorial-first/project/plugins/project/ akka-docs/exts/ +_akka_cluster/ \ No newline at end of file diff --git a/akka-actor/src/main/scala/akka/actor/Actor.scala b/akka-actor/src/main/scala/akka/actor/Actor.scala index 2b6232e060..31abf5400a 100644 --- a/akka-actor/src/main/scala/akka/actor/Actor.scala +++ b/akka-actor/src/main/scala/akka/actor/Actor.scala @@ -206,8 +206,20 @@ object Actor extends ListenerManagement { newLocalActorRef(clazz, address) case Deploy(_, router, Clustered(Home(hostname, port), replication , state)) => + sys.error("Clustered deployment not yet supported") + /* + if (Actor.remote.isRunning) throw new IllegalStateException("Remote server is not running") + val remoteAddress = Actor.remote.address + if (remoteAddress.getHostName == hostname && remoteAddress.getPort == port) { + // home node for actor + if (!node.isClustered(address)) node.store(clazz, address) + node.use(address).head + } else { + val router = + node.ref(address, router) + } + */ /* - 1. Check ZK for deployment config 2. Check Home(..) a) If home is same as Actor.remote.address then: - check if actor is stored in ZK, if not; node.store(..) @@ -216,7 +228,6 @@ object Actor extends ListenerManagement { - check out actor using node.ref(..) Misc stuff: - - Manage deployment in ZK - How to define a single ClusterNode to use? Where should it be booted up? How should it be configured? - Deployer should: 1. Check if deployment exists in ZK diff --git a/akka-actor/src/main/scala/akka/actor/Deployer.scala b/akka-actor/src/main/scala/akka/actor/Deployer.scala index 278e6f8a24..98ccfb51dd 100644 --- a/akka-actor/src/main/scala/akka/actor/Deployer.scala +++ b/akka-actor/src/main/scala/akka/actor/Deployer.scala @@ -143,10 +143,6 @@ object Deployer { lazy val cluster = ReflectiveAccess.ClusterModule.clusterDeployer lazy val local = new LocalDeployer - def deploy(deployment: Seq[Deploy]) { - deployment foreach (deploy(_)) - } - def deploy(deployment: Deploy) { if (deployment eq null) throw new IllegalArgumentException("Deploy can not be null") val address = deployment.address @@ -155,6 +151,10 @@ object Deployer { else local.deploy(deployment) } + def deploy(deployment: Seq[Deploy]) { + deployment foreach (deploy(_)) + } + private def deployLocally(deployment: Deploy) { deployment match { case Deploy(address, Direct, Clustered(Home(hostname, port), _, _)) => diff --git a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala index af8876815e..bab0ae5fb9 100644 --- a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala +++ b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala @@ -561,7 +561,7 @@ class ClusterNode private[akka] ( /** * Explicitly resign from being a leader. If this node is not a leader then this operation is a no-op. */ - def resign = if (isLeader.get) leaderLock.unlock + def resign() { if (isLeader.get) leaderLock.unlock } // ======================================= // Actor