diff --git a/akka-actor/src/main/scala/akka/cluster/ClusterInterface.scala b/akka-actor/src/main/scala/akka/cluster/ClusterInterface.scala index 9b31b28de0..f27ae58341 100644 --- a/akka-actor/src/main/scala/akka/cluster/ClusterInterface.scala +++ b/akka-actor/src/main/scala/akka/cluster/ClusterInterface.scala @@ -10,6 +10,7 @@ import akka.actor._ import akka.dispatch.Future import akka.config.Config import akka.util._ +import akka.AkkaException import com.eaio.uuid.UUID @@ -20,6 +21,8 @@ import java.util.concurrent.{ ConcurrentSkipListSet, ConcurrentHashMap } import scala.collection.mutable.ConcurrentMap import scala.collection.JavaConversions._ +class ClusterException(message: String) extends AkkaException(message) + object ChangeListener { /** diff --git a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala index 1da99f88b5..1d12c5dbdf 100644 --- a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala +++ b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala @@ -48,45 +48,6 @@ import java.util.{ List ⇒ JList } // FIXME add watch for each node that when the entry for the node is removed then the node shuts itself down // FIXME Provisioning data in ZK (file names etc) and files in S3 and on disk -class ClusterException(message: String) extends AkkaException(message) - -/** - * Node address holds the node name and the cluster name and can be used as a hash lookup key for a Node instance. - * - * @author Jonas Bonér - */ -class NodeAddress( - val clusterName: String, - val nodeName: String, - val hostname: String, - val port: Int) { - if ((hostname eq null) || hostname == "") throw new NullPointerException("Host name must not be null or empty string") - if ((nodeName eq null) || nodeName == "") throw new NullPointerException("Node name must not be null or empty string") - if ((clusterName eq null) || clusterName == "") throw new NullPointerException("Cluster name must not be null or empty string") - if (port < 1) throw new NullPointerException("Port can not be negative") - - override def toString = "%s:%s:%s:%s".format(clusterName, nodeName, hostname, port) - - override def hashCode = 0 + clusterName.## + nodeName.## + hostname.## + port.## - - override def equals(other: Any) = NodeAddress.unapply(this) == NodeAddress.unapply(other) -} - -object NodeAddress { - - def apply( - clusterName: String = Cluster.name, - nodeName: String = Config.nodename, - hostname: String = Config.hostname, - port: Int = Config.remoteServerPort): NodeAddress = - new NodeAddress(clusterName, nodeName, hostname, port) - - def unapply(other: Any) = other match { - case address: NodeAddress ⇒ Some((address.clusterName, address.nodeName, address.hostname, address.port)) - case _ ⇒ None - } -} - /** * JMX MBean for the cluster service. *