6 Replies Latest reply on Jan 17, 2005 2:57 AM by frito

    MBeans

    bigben

      Hello
      i am a new to Jboss and application servers.

      do MBeanServices exsits in all applications servers(if i create one can i us it in Weblogic as for example?).

      is it (MBeanSevice) the right way to load component that we want to be loaded?

      thanks

        • 1. Re: MBeans
          samfra

          Hello

          1. I think it's only for jboss (I'm sure)

          2. I would ask the same question ... But the is the only solution I found to have "loaded" components (with a lot of cache and so on)...

          • 2. Re: MBeans
            frito

            Several appservers use and provide JMX. AFAIK, weblogic does, too.
            I don't want to answer the second question since I don't know what you mean with "loading components". You can load data (for reading) using the classloaders without implementing any service.

            • 3. Re: MBeans
              mazz

              MBeans are standard objects following the JMX specification - so there really is nothing JBoss specific about them. Yes, WebLogic uses MBeans, too.

              If you write plain vanilla MBeans (that is, if you don't use JBoss-specific MBean support classes, like ServiceMBean - they can be "standard", "dynamic", "ModelMBean" or "OpenMBean" doesn't matter, so long as they conform to the JMX spec) you surely can take your MBean and deploy it both in JBoss or WebLogic or, for that matter, ANY piece of software that exposes an MBeanServer (you could create your own MBeanServer if you want!).

              However, JBoss provides nice MBean support classes - they assist you in writing MBeans that plug into the lifetime management mechanism that JBoss uses when starting and stopping. See ServiceMBeanSupport for more information (for example, see the start() and stop() methods).

              • 4. Re: MBeans
                mazz

                Oh, as for your second question, using an MBean as your "service" is the way JBoss works (well, assuming you are talking outside of J2EE, in which case you should be looking at .war/.ear deployment).

                So, yes, to load components, you simply write your MBean, and add its configuration to your configuration file. JBoss makes this part flexible too - you can put this directly in your conf/jboss-service.xml or you can bundle up your MBean (with its supporting classes/libs) in a .sar and deploy your .sar in the /deploy directory. There are a few other ways to deploy but those are the common ones.

                In short, yes, you write MBean services and deploy those MBeans in order to "load your components".

                Hopefully, I understood your question and answered it appropriately.

                • 5. re: MBeans
                  bigben

                  Tanks for your answers!
                  to clear my second question i mean for example i need to add a "service" that can replay my subscriber location, and in order to provide that i need to connect to external server and collect information from.so i understand that MBean can be the way to do that but is there any other way? and which way is better?
                  thanks :-)

                  • 6. Re: MBeans
                    frito

                    Depends on how you are going to realise the connection to the external server... but this sound very much like a MBean as best practice.