Created
February 10, 2012 19:59
-
-
Save scottmarlow/1792265 to your computer and use it in GitHub Desktop.
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
public class test1 { | |
public static void main(String args[]) { | |
final String host = "localhost"; | |
final int newPort = 9999; | |
String s = "service:jmx:remoting-jmx:///" + host + ":"+ newPort; | |
if (args.length > 1) { | |
s = args[1]; | |
} | |
try { | |
System.out.println("Connecting to: " + s); | |
javax.management.remote.JMXServiceURL url = new javax.management.remote.JMXServiceURL(s); | |
javax.management.remote.JMXConnector conn = javax.management.remote.JMXConnectorFactory.connect(url, null); | |
System.out.println("JMXConnectorFactory.connect(" + url +",null) returned connection = "+conn); | |
} catch(Exception e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment