2 Replies Latest reply on Mar 20, 2002 3:33 AM by Juha Lindfors

    Structured data in ModelMBean descriptor

    Trevor Squires Novice

      For some reason I assumed that MMBInfoSupport ought to be able to hold any sort of descriptor type (i.e. something other than mbean, operation, attribute etc). I figured that arbitrary descriptors would be the way to allow configuration beyond what is in the spec. Looking at the javadocs, it's pretty clear what it supports.

      So, failing that, my question is how safe is it supposed to be to put arbitrary and structured (non-text) data into the mbean descriptor. I.e. a java.util.List?

      Also, what sort of check is the descriptor's isValid supposed to do? Should I assume that it may barf on my own fields which are not known to the agent implementation?

      These may seem like dumb questions but I'm concerned about portability in the face of metadata classes that look like they may choke on *arbitrary* metadata.

      Thanks,
      Trev

        • 1. Re: Structured data in ModelMBean descriptor
          Adrian Brock Master

          Hi Trevor,

          I would guess that isValid should only validate
          fields mentioned in the spec for restrictions mentioned
          in the spec.

          e.g. a Visibility of '5' is not allowed
          or the Name must exist and be a String.

          But this is only a guess. It would be spec compliant
          the way I read it.

          Regards,
          Adrian

          • 2. Re: Structured data in ModelMBean descriptor
            Juha Lindfors Master

            > For some reason I assumed that MMBInfoSupport ought to be able to hold any sort of descriptor type (i.e.
            > something other than mbean, operation, attribute etc).

            you can only add one descriptor per a management interface element.

            > I figured that arbitrary descriptors would be the way to allow configuration beyond what is in the
            > spec.

            no, you add your own fields to the known interface elements.

            > So, failing that, my question is how safe is it supposed to be to put arbitrary and structured
            > (non-text) data into the mbean descriptor. I.e. a java.util.List?

            since the spec allows any arbitrary field to be added to a descriptor it is safe. any implementation that fails because of unknown field names (instead of just ignoring them) is implemented wrong, IMO.


            > Also, what sort of check is the descriptor's isValid supposed to do? Should I assume that it may barf on
            > my own fields which are not known to the agent implementation?

            no, it may not barf on unknown fields. I think isValid should only check for the existence of the mandatory fields: name, descriptorType (and role in case of constructors). That is a minimal "valid" descriptor for any element in the management interface.


            -- Juha