karlht: Mu the giggling dragon, as drawn by Max Toth in 1992-ish (Default)
Karl T. ([personal profile] karlht) wrote2007-05-01 12:00 pm

For the geeks among you

Why I don't code in Java:


         String hp = isa.getHostName() + ":" + isa.getPort();
         String s = "service:jmx:rim://" + hp + "/jndi/rmi://" + hp + "/jmxrmi";
         JMXServiceURL url = new JMXServiceURL(s);
         String login = getJMXUsername(isa);
         String password = getJMXPassword(isa);
         Map<String,Object> env = new HashMap<String,Object>(1);
         String[] creds = new String[] { login, password };
         env.put(JMXConnector.CREDENTIALS, creds);
         JMXConnector jmxc = JMXConnectorFactory.connect(url, env);

         // jmxc = new RMIJMXConnector(host, port, login, password); /* sigh */


(No, it's not my code. But I will have to test it, eventually. And I really feel for the fellow who has to write this stuff.)