You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "David Hosier (JIRA)" <ji...@apache.org> on 2007/01/03 19:45:27 UTC

[jira] Created: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

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.4, 1.2.3
            Reporter: David Hosier


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

        

[jira] Assigned: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-196:
------------------------------------

    Assignee: Eelco Hillenius

> 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

        

[jira] Commented: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462570 ] 

Eelco Hillenius commented on WICKET-196:
----------------------------------------

Martin, the code is updated. Mind testing that for us?

> 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
>             Fix For: 1.3, 2.0
>
>         Attachments: Initializer_patch, patch.txt
>
>
> 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

        

[jira] Updated: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "David Hosier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Hosier updated WICKET-196:
--------------------------------

    Attachment: Initializer_patch

> 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
>         Attachments: Initializer_patch
>
>
> 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

        

[jira] Reopened: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reopened WICKET-196:
----------------------------------


> 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
>             Fix For: 1.3, 2.0
>
>         Attachments: Initializer_patch, patch.txt
>
>
> 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

        

[jira] Resolved: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eelco Hillenius resolved WICKET-196.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0
                   1.3

Applied for 1.3 and 2.0.

If really needed for 1.2.x, please start a vote on the development list.

> 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
>             Fix For: 1.3, 2.0
>
>         Attachments: Initializer_patch, patch.txt
>
>
> 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

        

[jira] Commented: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "David Hosier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462356 ] 

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

I forgot to mention that I made this change against the 1.2.x branch checked out from the Subversion repository.

> 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
>         Attachments: Initializer_patch
>
>
> 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

        

[jira] Updated: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eelco Hillenius updated WICKET-196:
-----------------------------------

    Attachment: patch.txt

> 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
>         Attachments: Initializer_patch, patch.txt
>
>
> 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

        

[jira] Commented: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462382 ] 

Eelco Hillenius commented on WICKET-196:
----------------------------------------

added slightly altered patch

> 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
>         Attachments: Initializer_patch, patch.txt
>
>
> 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

        

[jira] Commented: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "David Hosier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462354 ] 

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

Ok, so what I've done is add the ability for a user to specify the MBeanServer implementation class in a System property called wicket.mbean.server.impl.  In the init() method, I get the list of all MBeanServers and take the one that matches the class name specified in the property.  If the property does not exist or does not match any registered servers, the first one in the list is taken as a default.  I also cached a reference to the MBeanServer as a global.  I also added some helpful comments.  I think they're helpful at least.  I tested against JBoss AS 4.0.3SP1, and I tried setting the property to the JVM MBeanServer class and also the JBoss MBeanServer class.  I also tested it with not setting the property at all.  Hopefully everything looks OK.

> 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
>         Attachments: Initializer_patch
>
>
> 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

        

[jira] Commented: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462569 ] 

Eelco Hillenius commented on WICKET-196:
----------------------------------------

getPlatformMBeanServer creates an instance if none already exists, so that is never null.

The new code supports both the ID and the class now, and defaults on the (recommended in SUN's docs) getPlatformMBeanServer call.

> 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
>             Fix For: 1.3, 2.0
>
>         Attachments: Initializer_patch, patch.txt
>
>
> 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

        

[jira] Commented: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462552 ] 

Eelco Hillenius commented on WICKET-196:
----------------------------------------

I'll change the implementation to use findMBeanServer when a property is provided; otherwise use the 'old' (but recommended) method.

Martin, can you tell us more about what you're running (OS, appserver, config)?

> 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
>             Fix For: 1.3, 2.0
>
>         Attachments: Initializer_patch, patch.txt
>
>
> 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

        

[jira] Commented: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462518 ] 

Martin Grigorov commented on WICKET-196:
----------------------------------------

I forgot to say that I am using truck (2.0).

Martin

> 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
>             Fix For: 1.3, 2.0
>
>         Attachments: Initializer_patch, patch.txt
>
>
> 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

        

[jira] Resolved: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eelco Hillenius resolved WICKET-196.
------------------------------------

    Resolution: Fixed

> 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
>             Fix For: 1.3, 2.0
>
>         Attachments: Initializer_patch, patch.txt
>
>
> 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

        

[jira] Commented: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "David Hosier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462561 ] 

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

I could be wrong, but I'm guessing that if Martin isn't getting any MBeanServers from the findMBeanServer(null) call, then getPlatformMBeanServer() won't return anything either and the code will throw an NPE at some point.  I should also note that I went with specifying the class instead of using the Agent ID in the findMBeanServer() call because an MBeanServer's Agent ID is usually random or uses the creation time in milliseconds in some way.  This is because the ID must be unique in the VM, and this makes it basically impossible to specify this deterministically.  Specifying the class name of the MBeanServer Impl was the only surefire way I could think of to specify what you want.

> 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
>             Fix For: 1.3, 2.0
>
>         Attachments: Initializer_patch, patch.txt
>
>
> 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

        

[jira] Commented: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462516 ] 

Martin Grigorov commented on WICKET-196:
----------------------------------------

Hi,

I have some problems with this functionality.

$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.get(ArrayList.java:322)
        at wicket.jmx.Initializer.init(Initializer.java:131)
        at wicket.Initializer.init(Initializer.java:59)
        at wicket.Application.callInitializers(Application.java:837)
        at wicket.Application.initializeComponents(Application.java:628)
        at wicket.protocol.http.WicketFilter.init(WicketFilter.java:343)
        at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:95)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
        ...

It looks like   
ArrayList<MBeanServer> mbeanServers = (ArrayList<MBeanServer>)MBeanServerFactory
                    .findMBeanServer(null);
returns empty list.

Martin



> 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
>             Fix For: 1.3, 2.0
>
>         Attachments: Initializer_patch, patch.txt
>
>
> 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

        

[jira] Commented: (WICKET-196) Ability to specify the MBean Server in which to register the Wicket MBeans

Posted by "David Hosier (JIRA)" <ji...@apache.org>.
    [ 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