ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-99

All MXBeans interfaces that don't use complex paramters need to be renamed as MBean interaces.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: jmx
    • Labels:
      None

      Description

      All the MXBean interfaces that I've looked at are standard MBean interfaces. The interface names should get renamed to MBean instaead of MXBean. That way the server can also run on a the Java 1.5 Platform.

        Activity

        Hide
        Eric Bowman added a comment -

        Here's a patch against r748487.

        This problem is quite an obstacle to embedding Zookeeper in JBoss, so it would be great if you could roll it into 3.2.

        The JMX convention (as implemented by JBoss, anyhow) requires that the MBean interfaces be named XXXMBean, and the implementing classes XXX.

        So I have renamed, for example, ZooKeeperServerMXBean to ZooKeeperServerBeanMBean, so that ZooKeeperServerBean can remain.

        I also made all the MBean interfaces extend ZKInfoMBean (formerly ZKMBeanInfo), instead of having each implementation implement it as well. I suppose that might controversial, but I couldn't see a good reason to have ZKInfoMBean references scattered around the implementation.

        Hope this is useful – it's necessary for us to use ZooKeeper, so we will be working off a patched version of the trunk until this or something equivalent makes its way into a release.

        Show
        Eric Bowman added a comment - Here's a patch against r748487. This problem is quite an obstacle to embedding Zookeeper in JBoss, so it would be great if you could roll it into 3.2. The JMX convention (as implemented by JBoss, anyhow) requires that the MBean interfaces be named XXXMBean, and the implementing classes XXX. So I have renamed, for example, ZooKeeperServerMXBean to ZooKeeperServerBeanMBean, so that ZooKeeperServerBean can remain. I also made all the MBean interfaces extend ZKInfoMBean (formerly ZKMBeanInfo), instead of having each implementation implement it as well. I suppose that might controversial, but I couldn't see a good reason to have ZKInfoMBean references scattered around the implementation. Hope this is useful – it's necessary for us to use ZooKeeper, so we will be working off a patched version of the trunk until this or something equivalent makes its way into a release.
        Hide
        Patrick Hunt added a comment -

        Hi Eric, I'm not an expert on jmx, but I believe the original contributors of this code used mxbeans for a reason. In particular:

        See this blog post by one of the authors of mxbeans:
        http://weblogs.java.net/blog/emcmanus/archive/2006/02/what_is_an_mxbe.html
        "Going forward, it will generally be a good idea to write an MXBean wherever you would write a Standard MBean today."

        http://java.sun.com/javase/6/docs/api/javax/management/MXBean.html
        "The MXBean concept provides a simple way to code an MBean that only references a predefined set of types, the ones defined by javax.management.openmbean. In this way, you can be sure that your MBean will be usable by any client, including remote clients, without any requirement that the client have access to model-specific classes representing the types of your MBeans."

        http://marxsoftware.blogspot.com/2008/06/jmx-mxbean.html
        "MXBeans in Java SE 6: Bundling Values without Special JMX Client Configurations recommends using MXBeans in any Java SE 6 application where Standard MBeans may have been used before moving to Java SE 6."
        This blog post also shows that in some cases JMX UIs render the bean fields better with mxbeans than with std mbeans

        Can you explain a bit about why ZooKeeper cannot be embedded into JBoss currently? Doesn't JBoss support MXBeans? This was standardized in java6, no? (that mxbeans are included in 1.6).

        From what I read it seems like moving from mx -> standard mbeans is a step back. But I'd like to understand the problems seen with JBoss. If you can include some code/config that I could easily deploy into JBoss I'd be happy to try it out myself - perhaps we could include this in our testing regime so that we maintain compatibility going forward.

        ps. we dropped java5 support in 3.1, we now only support java6, so the original description of the jira is stale. See ZOOKEEPER-210

        Show
        Patrick Hunt added a comment - Hi Eric, I'm not an expert on jmx, but I believe the original contributors of this code used mxbeans for a reason. In particular: See this blog post by one of the authors of mxbeans: http://weblogs.java.net/blog/emcmanus/archive/2006/02/what_is_an_mxbe.html "Going forward, it will generally be a good idea to write an MXBean wherever you would write a Standard MBean today." http://java.sun.com/javase/6/docs/api/javax/management/MXBean.html "The MXBean concept provides a simple way to code an MBean that only references a predefined set of types, the ones defined by javax.management.openmbean. In this way, you can be sure that your MBean will be usable by any client, including remote clients, without any requirement that the client have access to model-specific classes representing the types of your MBeans." http://marxsoftware.blogspot.com/2008/06/jmx-mxbean.html "MXBeans in Java SE 6: Bundling Values without Special JMX Client Configurations recommends using MXBeans in any Java SE 6 application where Standard MBeans may have been used before moving to Java SE 6." This blog post also shows that in some cases JMX UIs render the bean fields better with mxbeans than with std mbeans Can you explain a bit about why ZooKeeper cannot be embedded into JBoss currently? Doesn't JBoss support MXBeans? This was standardized in java6, no? (that mxbeans are included in 1.6). From what I read it seems like moving from mx -> standard mbeans is a step back. But I'd like to understand the problems seen with JBoss. If you can include some code/config that I could easily deploy into JBoss I'd be happy to try it out myself - perhaps we could include this in our testing regime so that we maintain compatibility going forward. ps. we dropped java5 support in 3.1, we now only support java6, so the original description of the jira is stale. See ZOOKEEPER-210
        Hide
        Eric Bowman added a comment -

        I'm certainly no expert on JMX; these are just changes that were necessary to make this work with JBoss 4.2.2.GA, which has code which explicitly looks for an interface on a class XXX named XXXMBean, at least for static MBeans.

        It does seem that embedding Zookeeper isn't much of a priority, so maybe it's not worth the effort; I do find it pretty handy to do so, though, and the MXBean approach doesn't work for me.

        Show
        Eric Bowman added a comment - I'm certainly no expert on JMX; these are just changes that were necessary to make this work with JBoss 4.2.2.GA, which has code which explicitly looks for an interface on a class XXX named XXXMBean, at least for static MBeans. It does seem that embedding Zookeeper isn't much of a priority, so maybe it's not worth the effort; I do find it pretty handy to do so, though, and the MXBean approach doesn't work for me.
        Hide
        Patrick Hunt added a comment -

        I'd still like to try this out regardless of priority. Can you attach the basic configuration (ear file?) that I would need to try this out? I'd do it myself but I'm not familiar with JBoss and it would take some time to reproduce what you've already done.

        Show
        Patrick Hunt added a comment - I'd still like to try this out regardless of priority. Can you attach the basic configuration (ear file?) that I would need to try this out? I'd do it myself but I'm not familiar with JBoss and it would take some time to reproduce what you've already done.
        Hide
        Hiram Chirino added a comment -

        Hi Patrick, if it runs fine on java 1.5, then it should run fine in JBoss.

        Show
        Hiram Chirino added a comment - Hi Patrick, if it runs fine on java 1.5, then it should run fine in JBoss.

          People

          • Assignee:
            Unassigned
            Reporter:
            Hiram Chirino
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development