Hi,
I have been using the JMX support in the sandbox and have encountered the following:
When I annotate my class thus,
the commons-attributes 'pre-compilation' step does not generate the objectName (_attr.setObjectName( ) value correctlyCode:/** * This type represents some object which will be exposed and managed via JMX. * <br> * * @@org.springframework.jmx.metadata.support.ManagedResource(objectName="com.domain:name=Service") */ public class ManagedService { ... }
i.e.Code:... private void initClassAttributes () { { org.springframework.jmx.metadata.support.ManagedResource _attr = new org.springframework.jmx.metadata.support.ManagedResource( // edited by SB ); _attr.setObjectName( "com.domain.name=Service" ); Object _oattr = _attr; // Need to erase type information if (_oattr instanceof org.apache.commons.attributes.Sealable) { ((org.apache.commons.attributes.Sealable) _oattr).seal (); } classAttributes.add ( _attr ); } } ...
the "com.domain:name=Service" becomes "com.domain.name=Service" the : (colon) becomes . (a period).
_attr.setObjectName(
"com.domain.name=Service"
);
This is an error in the commons-attributes which I have been unable locate.
Can anyone help with a fix ?
Plus it looks as if the class definition structure is significant if the 'pre-compilation' step is to work.
Specifically the "package" and "import" statements _must_ come before the class comment otherwise the #initClassAttributes() is generated as a no-op (empty) method.
PS. I have posted here because there was no "sandbox/jmx/" section.


Reply With Quote