Add back Cluster JMX, see 2311

* Separate class
* Simple test
This commit is contained in:
Patrik Nordwall 2012-07-05 11:56:54 +02:00
parent ce9f530c32
commit 17f0ce9f89
3 changed files with 121 additions and 4 deletions

View file

@ -13,6 +13,8 @@ import akka.actor.Address
import java.util.concurrent.atomic.AtomicInteger
import akka.remote.RemoteActorRefProvider
import InternalClusterAction._
import java.lang.management.ManagementFactory
import javax.management.ObjectName
object ClusterSpec {
val config = """
@ -57,6 +59,13 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender {
cluster.selfAddress must be(selfAddress)
}
"register jmx mbean" in {
val name = new ObjectName("akka:type=Cluster")
val info = ManagementFactory.getPlatformMBeanServer.getMBeanInfo(name)
info.getAttributes.length must be > (0)
info.getOperations.length must be > (0)
}
"initially become singleton cluster when joining itself and reach convergence" in {
cluster.isSingletonCluster must be(false) // auto-join = off
cluster.join(selfAddress)