Results 1 to 2 of 2

Thread: JMX Support, commons-attributes

  1. #1
    Join Date
    Aug 2004
    Location
    columbia, md
    Posts
    12

    Default JMX Support, commons-attributes

    Hi,
    I have been using the JMX support in the sandbox and have encountered the following:

    When I annotate my class thus,
    Code:
        /**
         * This type represents some object which will be exposed and managed via JMX.
         * <br>
         *
         * @@org.springframework.jmx.metadata.support.ManagedResource&#40;objectName="com.domain&#58;name=Service"&#41;
         */
    
        public class ManagedService
        &#123;
            ...
        &#125;
    the commons-attributes 'pre-compilation' step does not generate the objectName (_attr.setObjectName( ) value correctly
    Code:
        ...
        private void initClassAttributes &#40;&#41; &#123;
            &#123;
            org.springframework.jmx.metadata.support.ManagedResource _attr =
                new org.springframework.jmx.metadata.support.ManagedResource&#40;
                    // edited by SB
                &#41;;
            _attr.setObjectName&#40;
                "com.domain.name=Service"
            &#41;;
            Object _oattr = _attr; // Need to erase type information
            if &#40;_oattr instanceof org.apache.commons.attributes.Sealable&#41; &#123;
                &#40;&#40;org.apache.commons.attributes.Sealable&#41; _oattr&#41;.seal &#40;&#41;;
            &#125;
            classAttributes.add &#40; _attr &#41;;
            &#125;
        &#125;
        ...
    i.e.
    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.
    sinclair

  2. #2
    Join Date
    Aug 2004
    Location
    columbia, md
    Posts
    12

    Default

    The solution to this error seems to be to introduce spaces around the <objectName> assignment:

    Code:
    @@org.springframework.jmx.metadata.support.ManagedResource&#40;objectName = "com.domain&#58;name=Service"&#41;
    Don't know why this works ... but it does.
    sinclair

Similar Threads

  1. MethodSecurityInterceptor not working?
    By asarco in forum Security
    Replies: 14
    Last Post: Mar 31st, 2008, 09:59 AM
  2. Replies: 5
    Last Post: Mar 2nd, 2005, 07:11 AM
  3. Replies: 8
    Last Post: Dec 7th, 2004, 06:13 PM
  4. Replies: 9
    Last Post: Oct 23rd, 2004, 12:07 PM
  5. Commons Validator integration
    By sjivan in forum Web
    Replies: 3
    Last Post: Oct 14th, 2004, 04:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •