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.
> 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
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.