Merge branch 'master' into wip-2214-heartbeats-patriknw

Conflicts:
	akka-cluster/src/main/scala/akka/cluster/AccrualFailureDetector.scala
	akka-cluster/src/main/scala/akka/cluster/Cluster.scala
This commit is contained in:
Patrik Nordwall 2012-06-11 22:27:08 +02:00
commit a7d2be10eb
31 changed files with 384 additions and 230 deletions

View file

@ -5,7 +5,7 @@ package akka.cluster
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import akka.actor.Address
import akka.actor.{Address, ExtendedActorSystem}
import akka.remote.testconductor.RoleName
import akka.remote.testkit.MultiNodeSpec
import akka.testkit._
@ -29,14 +29,19 @@ object MultiNodeClusterSpec {
""")
}
trait MultiNodeClusterSpec { self: MultiNodeSpec
trait MultiNodeClusterSpec extends FailureDetectorStrategy { self: MultiNodeSpec
override def initialParticipants = roles.size
/**
* Get or create a cluster node using 'Cluster(system)' extension.
* The cluster node instance. Needs to be lazily created.
*/
def cluster: Cluster = Cluster(system)
private lazy val clusterNode = new Cluster(system.asInstanceOf[ExtendedActorSystem], failureDetector)
/**
* Get the cluster node to use.
*/
def cluster: Cluster = clusterNode
/**
* Use this method instead of 'cluster.self'
@ -49,9 +54,7 @@ trait MultiNodeClusterSpec { self: MultiNodeSpec ⇒
* nodes (roles). First node will be started first
* and others will join the first.
*/
def startCluster(roles: RoleName*): Unit = {
awaitStartCluster(false, roles.toSeq)
}
def startCluster(roles: RoleName*): Unit = awaitStartCluster(false, roles.toSeq)
/**
* Initialize the cluster of the specified member