<!-- 
RSS generated by JIRA (4.4#649-r158309) at Thu May 23 06:50:09 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/JMX-6/JMX-6.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[JMX-6] Result of clojure.java.jmx.Bean.getAttribute is not a javax.management.Attribute</title>
                <link>http://dev.clojure.org/jira/browse/JMX-6</link>
                <project id="10060" key="JMX">java.jmx</project>
                        <description>&lt;p&gt;The documentation suggests that you create a JMX bean (clojure.java.jmx.Bean) by calling clojure.java.jmx/create-bean on a reference to a map whose values are the actual values you want as attributes: for instance, (create-bean (ref {:calls-so-far 0})).  However, if you do this, when you get the attribute out using .getAttribute the result is the actual state value, and not the javax.management.Attribute in question as the interface specifies.  This also causes a ClassCastException when you try to call .getAttributes or anything else that tries to add the attributes to an AttributeList.&lt;/p&gt;

&lt;p&gt;The attached patch fixes this problem by wrapping the state value in a call to Attribute. so that .getAttribute yields an Attribute, and modifies objects-&amp;gt;data to descend into Attribute values accordingly.  The tests work, and it works for my use case, but I do not know whether this is the right solution in general.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15599">JMX-6</key>
            <summary>Result of clojure.java.jmx.Bean.getAttribute is not a javax.management.Attribute</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="5" iconUrl="http://dev.clojure.org/jira/images/icons/status_resolved.gif">Resolved</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="bccjeris">Chris Jeris</assignee>
                                <reporter username="bccjeris">Chris Jeris</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Jul 2012 09:07:14 -0500</created>
                <updated>Fri, 28 Sep 2012 21:59:32 -0500</updated>
                    <resolved>Fri, 28 Sep 2012 21:59:32 -0500</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="29088" author="nickmbailey" created="Mon, 6 Aug 2012 16:35:40 -0500"  >&lt;p&gt;Chris,&lt;/p&gt;

&lt;p&gt;Thanks for submitting a patch for this. I&apos;ll be able to review it sometime in the next few days hopefully.&lt;/p&gt;</comment>
                    <comment id="29333" author="nickmbailey" created="Fri, 31 Aug 2012 16:40:23 -0500"  >&lt;p&gt;Chris,&lt;/p&gt;

&lt;p&gt;Sorry for the delay.&lt;/p&gt;

&lt;p&gt;Whats the reason for the addition to objects-&amp;gt;data? By that point we&apos;ve already read the attribute list for a bean and are processing the attribute values right?&lt;/p&gt;</comment>
                    <comment id="29423" author="juergenhoetzel" created="Tue, 11 Sep 2012 04:25:17 -0500"  >&lt;p&gt;I don&apos;t see whats wrong in the implementation of the DynamicMbean interface:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
({:name getAttribute,                                                                                              
  :return-type java.lang.Object,                                                                                   
  :declaring-class javax.management.DynamicMBean,                                                                  
  :parameter-types [java.lang.String],                                                                             
  :exception-types                                                                                                 
  [javax.management.AttributeNotFoundException                                                                     
   javax.management.MBeanException                                                                                 
   javax.management.ReflectionException],                                                                          
  :flags #{:public :abstract}})       

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;the return type is &lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; java.lang.Object&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; , not  &lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; javax.management.Attribute&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; &lt;/p&gt;</comment>
                    <comment id="29424" author="nickmbailey" created="Tue, 11 Sep 2012 11:14:54 -0500"  >&lt;p&gt;The documentation there is somewhat vague. Perhaps that part of the api shouldn&apos;t be changed. It seems like at least the .getAttributes implementation at least is wrong though. The documentation for AttributeList is clear that only Attribute objects should be added to the AttributeList, but it looks like all current jvm implementations (or ones we test with) don&apos;t do a good job of actually enforcing that.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://docs.oracle.com/javase/1.5.0/docs/api/javax/management/AttributeList.html&quot;&gt;http://docs.oracle.com/javase/1.5.0/docs/api/javax/management/AttributeList.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Do we know if any built in dynamic mbeans return Attribute objects or the actual values of a specific attribute?&lt;/p&gt;</comment>
                    <comment id="29493" author="nickmbailey" created="Tue, 18 Sep 2012 22:45:27 -0500"  >&lt;p&gt;Ok, found better documentation here.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://docs.oracle.com/cd/E19698-01/816-7609/6mdjrf83d/index.html&quot;&gt;http://docs.oracle.com/cd/E19698-01/816-7609/6mdjrf83d/index.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So getAttribute should be returning an attributes value rather than an actual attribute object. But as I mentioned before, getAttributes should be returning a list of Attribute objects.&lt;/p&gt;</comment>
                    <comment id="29494" author="nickmbailey" created="Tue, 18 Sep 2012 22:46:05 -0500"  >&lt;p&gt;Going to go ahead and update the patch accordingly.&lt;/p&gt;</comment>
                    <comment id="29495" author="nickmbailey" created="Tue, 18 Sep 2012 22:59:43 -0500"  >&lt;p&gt;Updated patch. Look good &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;http://dev.clojure.org/jira/secure/ViewProfile.jspa?name=bccjeris&quot; class=&quot;user-hover&quot; rel=&quot;bccjeris&quot;&gt;&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;http://dev.clojure.org/jira/images/icons/user_12.gif&quot; height=&quot;12&quot; width=&quot;12&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;Chris Jeris&lt;/a&gt;&lt;/span&gt;?&lt;/p&gt;</comment>
                    <comment id="29559" author="bccjeris" created="Fri, 28 Sep 2012 16:16:57 -0500"  >&lt;p&gt;Looks good and works for my use case.  Sorry for the delay &amp;#8211; I appear not to have email notifications from this JIRA configured correctly.&lt;/p&gt;</comment>
                    <comment id="29566" author="nickmbailey" created="Fri, 28 Sep 2012 21:59:32 -0500"  >&lt;p&gt;Committed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11510" name="0001-Return-a-list-of-Attribute-objects-from-.getAttribut.patch" size="2722" author="nickmbailey" created="Tue, 18 Sep 2012 22:58:37 -0500" />
                    <attachment id="11400" name="java-jmx-attribute-patch" size="2342" author="bccjeris" created="Thu, 26 Jul 2012 09:07:14 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10005">Accepted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Patch</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10012">Accepted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>
</channel>
</rss>