Created
May 17, 2013 20:45
-
-
Save gertv/5601849 to your computer and use it in GitHub Desktop.
Quick code snippet that show how to set up a JMX connection to Apache ServiceMix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root"); | |
Map<String, Object> parameters = new HashMap<String, Object>(); | |
String[] credentials = new String[] {"smx" ,"smx" }; | |
parameters.put("jmx.remote.credentials", credentials); | |
JMXConnector jmxc = JMXConnectorFactory.connect(url, parameters); | |
MBeanServerConnection mbsc = jmxc.getMBeanServerConnection(); | |
// TODO: work with the connection here! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment