4 Replies Latest reply on Jan 27, 2006 4:04 PM by fabcipriano

    Accessing mbean attributes through invoke()

    dimitris

      As it is now (4.0.x), standard mbean attributes can only be accessed as attributes, but xmbean attributes can also be accessed as operations (see http://jira.jboss.com/jira/browse/JBAS-1930).

      Fabiano also noted that according to JMX 1.2, this behaviour was unspecified in the previous jmx specs, but from 1.2, attributes should not be accessed as operations, unless there is a property defined "jmx.invoke.getters" (we don't implement) that is supposed to enable this behaviour (see http://jira.jboss.com/jira/browse/JBAS-1980).

      Obviously, we are somewhere in between, as a side effect of our xmbean metadata adding get/set metadata operations for attributes.

      I don't agree though with the solution proposed in JBAS-1980 that conditionally (jmx.invoke.getters == set) enhances the xmbean and standard mbean metadata with attribute operations.

      I think the exposed metadata (mbean info) should always be the same, independent whether we allow attribute access through invoke or not.

      So rather than enhancing the metadata to get the jmx.invoke.getters effect, I think we should instead enhance AbstractMBeanInvoker.initOperationContexts() to conditionally enable this type of access.

      Thoughts?