You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Jörn Zaefferer (JIRA)" <ji...@apache.org> on 2008/09/17 18:17:44 UTC

[jira] Updated: (WICKET-1841) Improvement to enable wicket-jmx-panel to work with MBeanServerConnection

     [ https://issues.apache.org/jira/browse/WICKET-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörn Zaefferer updated WICKET-1841:
-----------------------------------

    Attachment: wicketstuff-jmx-panel-remote.patch

Patch, see issue description.

> Improvement to enable wicket-jmx-panel to work with MBeanServerConnection
> -------------------------------------------------------------------------
>
>                 Key: WICKET-1841
>                 URL: https://issues.apache.org/jira/browse/WICKET-1841
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-jmx
>    Affects Versions: 1.3.4
>            Reporter: Jörn Zaefferer
>         Attachments: wicketstuff-jmx-panel-remote.patch
>
>
> I'm attaching a patch that enables wicket-jmx-panel to work with a MBeanServerConnection (super interface of MBeanServer). This is necessary to display interact with JMX beans. The patch also enables the user to select the MBeanServer to use, which isn't possible so far.
> To illustrate the usage of my patched code, here is a simple example:
> public class Admin extends WebPage {
> 	@SpringBean
> 	private MBeanServerConnection jmxClient;
> 	
> 	public Admin() {
> 		add(new JmxPanel("jmx", JmxPanelRenderer.Tree, new JmxMBeanServerWrapper() {
> 			@Override protected Object load() {
> 				return jmxClient;
> 			}
> 		}));
> 	}
> }	
> The jmxClient bean is configured via Spring, in my case with JavaConfig:
> public @Bean MBeanServerConnectionFactoryBean jmxClient() throws MalformedURLException {
> 	MBeanServerConnectionFactoryBean factory = new MBeanServerConnectionFactoryBean();
> 	factory.setConnectOnStartup(false);
> 	factory.setServiceUrl("service:jmx:rmi://localhost/jndi/rmi://localhost:1099/server");
> 	return factory;
> }
> To enable the rmi jmx connector on the server:
> public @Bean RmiRegistryFactoryBean rmiRegistry() throws Exception {
> 	return new RmiRegistryFactoryBean();
> }
> public @Bean(dependsOn="rmiRegistry") ConnectorServerFactoryBean jmxServer() throws MalformedObjectNameException {
> 	ConnectorServerFactoryBean factory = new ConnectorServerFactoryBean();
> 	factory.setObjectName("connector:name=rmi");
> 	factory.setServiceUrl("service:jmx:rmi://localhost/jndi/rmi://localhost:1099/tomfyweb");
> 	return factory;
> }
> Replacing RMI with a different connector/protocol is quite easy this way.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.