6 Replies Latest reply on Oct 10, 2004 3:02 PM by dimitris

    New PersistenceManager for XMBeans

    dimitris

      There is a new PersistenceService for XMBeans, along with an XML-based AttributePersistenceManager implementation.

      Details can be found at:

      http://www.jboss.org/wiki/Wiki.jsp?page=XMBeanAttributePersistenceService

      Cheers
      /Dimitris

        • 1. Re: New PersistenceManager for XMBeans
          debarcar

          I have a question about this:

          If the persistence file was updated by this services, then will the Scanner find the file changed and re-deploy the mbean again?

          Thanks and best regards!

          Debarcar

          • 2. Re: New PersistenceManager for XMBeans
            dimitris

            Hi,

            The persistence file, which is one per XMBean and by default has its ObjectName, e.g. ./data/xmbean-attrs/jboss.jmx@92name@32myservice.xml, is saved to a different directory than ./deploy.

            The deployment scanner has nothing to do with it. XMBean persistence is something happening in the "background", whenever you set attributes on the persistent XMBean.

            Now, when a persistent XMBean is re-deployed, the persisted attributes will be reloaded.

            There is a issue there, that deployment may override the loaded attributes, if attributes sets are specified in the original mbean descriptor (not the xmbean). To overcome this, you need either not specify attribute overrides there, or move them to the XMBean descriptor using the special

            <descriptor


            attribute syntax. Read the jboss docs for more info.

            Ok?

            /Dimitris

            • 3. Re: New PersistenceManager for XMBeans
              debarcar

              Hi Dimitris,

              It seems the solution is better than my expectation. And I have two following questions:

              1) If I add a new MBean, such as add a new Destination in JMS, can this solution store the new one for me?

              2) It seems the persistence function is only for the Model MBeans, can I let it also support the common MBeans?

              Thanks and best regards!

              Debarcar

              • 4. Re: New PersistenceManager for XMBeans
                dimitris

                 

                "debarcar" wrote:
                Hi Dimitris,
                It seems the solution is better than my expectation. And I have two following questions:

                1) If I add a new MBean, such as add a new Destination in JMS, can this solution store the new one for me?
                2) It seems the persistence function is only for the Model MBeans, can I let it also support the common MBeans?


                1) If you add it through the jmx-console, there will be no xml descriptor in deploy and your service will not be persistent. You'll have to generate the mbean+xmbean descriptor and copy it to the deploy directory to have a truly persistent service (i.e. make a "factory" MBean service of yours). We, too, are thinking of creating somekind of descriptor factory for common services to achieve exactly this, but it still in the works.

                2) You can use an XMBean descriptor to "wrap" as ModelMBean plain old Standard MBeans. For example, if you look at the JNDIView service, started from conf/jboss-service.xml, this used to be a plain Service MBean, but at some point an XMBean wrapper was added, so that useful metadata description could be displayed through the jmx-console.

                Regards
                /Dimitris

                • 5. Re: New PersistenceManager for XMBeans
                  debarcar

                  Hi Dimitris,

                  I tested the persistence service and perhaps a issue found:

                  If I added the default value to the string in the jboss-service.xml like
                  <!-- Normal Attribute Overrides Here, for Example: -->

                  <some-message>Welcome to the Athens 2004, Olympic Games!</some-message>

                  string in xml

                  and I update the String value in the jmx console to such as "string in persistence".

                  After the server reboot, the value of the String will be "string in xml". It seems the persistence value will be replace by the xml value.

                  I check the code and I think the order of ServiceConfigurator.internalInstall is incorrect.

                  I hope the persistence value will replace the xml value. Could you please tell me what I can do?

                  Thanks and best regards!

                  Debarcar

                  • 6. Re: New PersistenceManager for XMBeans
                    dimitris

                    That's normal behaviour in JBoss, the attributes you specify in the mbean descriptor always override the persisted values.

                    The way to do it is to specify your initial values in the xmbean descriptor instead, using the tag, see:

                    http://www.jboss.org/wiki/Wiki.jsp?page=HowCanIInitializeXMBeanAttributes