3 Replies Latest reply on Jan 12, 2006 7:51 AM by jerrygauth

    Distributed MBeans

    mreasy

      Hi,

      I am trying to programmatically create MBean instances that should be shared across the cluster nodes.
      As each node has its own MBeanServer I can't find a direct solution on creating and synchronizing those MBeans. - Ideas on how this could be solved?

      My next thought was to create a singleton service that creates and provides access to the MBeans on the master node.
      This works fine, but in case of a master-node-switch, the MBean instances are not re-created on the new master.

      Is there a way to create MBean instances that are distributed/shared across the cluster nodes?
      Or: is there a way MBeans on the master node can be re-constructed in case of a master node switch (I guess not, as the state is gone with the old master)?

      Thanks in advance for any help.

        • 1. Re: Distributed MBeans

          JBossCache running in replication mode is an example of a service that ''s exposed via an mbean on each node.

          If you want to use the singleton mbean approach, you can store your state in one of the replicated JBoss services (JBossCache, HA-JNDI or DistributedState). When you need to nominate a new master node, you can obtain the state from the service on that node and then dynamically register the associated mbean.

          • 2. Re: Distributed MBeans
            mreasy

            thanks for your answer.

            The DistributedState indeed seems to fit my needs (presuming there is no AppServer-independent solution).
            I already searched for more information on this, also read the Javadoc and Wiki, but have not been able so far to understand how to actually use it.

            Maybe you have some doc or anything you could point me to.

            • 3. Re: Distributed MBeans

              If you require an app server independent solution, JBossCache can be used with other app servers. HA-JNDI and DistributedState have dependencies on JBossAS.

              The JBossAS Clustering manual contains a brief description of DistributedState. See the index for its location. http://docs.jboss.org/jbossas/clustering/JBossClustering7.pdf

              One place to look for sample code is in the testsuite. There's a test case for DistributedState in org.jboss.test.cluster.test.DistributedStateTestCase.