title: Change @ManagedResource objectName dynamically
body: <p>I am creating prototype beans programatically/dynamically. I want those beans after initiation to be in the jmx console. How I can distinguish between them? I am using anotations in order to add my beans to the jmx and I have</p>
  
  <pre><code>@ManagedResource(objectName="bean:name=MybBean")
  </code></pre>
  
  <p>I need to inject the objectName dynamically. Any idea how could I do it?</p>
  
  <p>Here's my jmx configuration:</p>
  
  <pre><code>&lt;context:mbean-export server="mbeanServer" /&gt;
  
  &lt;bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean" /&gt;
  
  &lt;bean id="exporter" class="org.springframework.jmx.export.MBeanExporter"
          lazy-init="false"&gt;
  
          &lt;property name="beans"&gt;
              &lt;map&gt;
                  &lt;entry key="Server:name=HttpAdaptor"&gt;
                      &lt;bean class="mx4j.tools.adaptor.http.HttpAdaptor"&gt;
                          &lt;property name="port" value="8000" /&gt;
                          &lt;property name="host" value="0.0.0.0" /&gt;
                          &lt;property name="processor"&gt;
                              &lt;bean class="mx4j.tools.adaptor.http.XSLTProcessor" /&gt;
                          &lt;/property&gt;
  
                      &lt;/bean&gt;
                  &lt;/entry&gt;                
              &lt;/map&gt;
          &lt;/property&gt;
          &lt;property name="listeners"&gt;
              &lt;list&gt;
                  &lt;!--
  
                  --&gt;
                  &lt;bean class="com.fixgw.jmx.HttpAdaptorMgr"&gt;
                      &lt;property name="mbeanServer" ref="mbeanServer" /&gt;
                  &lt;/bean&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
     &lt;bean id="sessionMDB" class="com.fixgw.mdb.SessionMDB"
          scope="prototype" lazy-init="true"&gt;
          &lt;constructor-arg ref="0" /&gt;
          &lt;constructor-arg ref="0" /&gt;
      &lt;/bean&gt;
  </code></pre>