[ 
https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462107
 ] 

David Hosier commented on WICKET-196:
-------------------------------------

The best thing I can come up with so far is to allow users to specify the 
MBeanServer implementation class in a system property.  You can retrieve the 
list of all MBeanServers in the VM by calling: 
MBeanServerFactory.findMBeanServer(null).  This returns an ArrayList of 
MBeanServer objects over which the code could loop and match the first one 
whose class matches that specified by the system property.  If there is no 
match or the property is not set, just take the zero entry from the ArrayList 
of MBeanServers.  One downside to this approach is that it is technically 
possible to have multiple MBeanServers of the same class.  I do not know how 
likely this is to be encountered though.  I originally thought we could use 
findMBeanServer() and pass it the agent ID of desired MBeanServer, but this 
value is unpredictable and usually has some randomness such that specifying it 
in a property would basically be impossible.

> Ability to specify the MBean Server in which to register the Wicket MBeans
> --------------------------------------------------------------------------
>
>                 Key: WICKET-196
>                 URL: https://issues.apache.org/jira/browse/WICKET-196
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-jmx
>    Affects Versions: 1.2.3, 1.2.4
>            Reporter: David Hosier
>         Assigned To: Eelco Hillenius
>
> Following is a conversation between Igor and I:
> <dmhosier> You may be able to utilize this call instead:
> <dmhosier> 
> http://java.sun.com/j2ee/1.4/docs/api/javax/management/MBeanServerFactory.html#findMBeanServer(java.lang.String)
> <dmhosier> but there would have to be some way to specify the agent ID
> <ivaynberg> hmm
> <ivaynberg> a system prop?
> <dmhosier> probably the best bet
> <dmhosier> maybe check if a specified property exists, and use this method to 
> get the server, otherwise default to what you have now
> <ivaynberg> yeah

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to