2 Replies Latest reply on Jun 16, 2004 8:43 AM by chrisdutz

    Forcing XMBeans to update their persistant attributes?

    chrisdutz

      Hi,

      is there a way to tell the MBean server to store changes in an attributes value. Since a dom4j document seems not to be serializable I am using a get/setDocumentAsText method for persistance of the xml-document. In my application I only use get/setDocument. the document attribute is not persisted. My problem now is, if the application changes anything in the document and uses the setDocument method to change the original document I have no way of telling the server that the value for the persistant attribute documentAsText has changed without a dummy-jmx-call. Can I do this directly ... simply tell the MBean server that this MBean is dirty?

      Chris

        • 1. Re: Forcing XMBeans to update their persistant attributes?
          raja05

          What you can do is create a NotificationEvent from setDocument and make ur MBean Capture that event. Your Mbean Event capture code can then update the documentAsText Field which will be the new value!!

          • 2. Re: Forcing XMBeans to update their persistant attributes?
            chrisdutz

            This sounds sort of very imperformant. If I have to do it that way. there is no need for having a Document type attribute. Then I should simply stor the text.

            I managed my XMBean to store Document-objects now. To load an xml-file into this attibute I added a managed operation to the XMBean which reads a file and stores the resulting Document in the corresponding attribute of my XMBean. If I want to make the changes persistant, I have to store the object through the MBean server instead of using the local setDocument or directly storing it at this.document.

            Is there a way of telling the MBean server do persist the XMBean manually?

            Chris