2 Replies Latest reply on May 21, 2002 1:44 PM by juha

    Dynamic vs Model MBeans

    joerage

      Hi,

      I am doing a project in which I would like to be able to change the application parameters, to register new versions of components without having to restart the system. I know that JMX can help me achieve that. I have trouble in deciding either using Dynamic MBeans or Model MBeans.

      Can somebody help me understand the difference between the two and the advantages and didsavantages of using one instead of the other.

      Thanks

        • 1. Re: Dynamic vs Model MBeans
          ritesh

          You might want to check out Juha's Book on JMX from Sams publication, it has what you need in detail.

          Ritesh

          • 2. Re: Dynamic vs Model MBeans

            Everything you can do with Model MBeans you can also do with Dynamic MBeans, as Model MBeans are just an extension of Dynamic.

            However, a plain Dynamic MBean itself doesn't do much, so you may end up implementing alot of features repeatedly.

            Model MBeans provide a "template" of a sorts that can implement a host of generic functionality, such as logging, attribute caching, method mapping, attribute persistence, and so on. Also, the Model MBeans separate the managed resource object from the MBean implementation, and your object may be completely unaware that it is being "managed". Another very powerful feature of Model MBeans is the ability to set descriptors for each element in the management interface, describing the behaviour of attributes, operations, notifications, and so on. These are used to control the behaviors I listed above (logging, persistence, etc) but can also be used for any application specific features. For example, in JBossMX it is possible to intercept the invocations to the managed resource and control the management behaviour based on these descriptor values.

            HTH,

            -- Juha