class JmxConnectionBuilder {

    public MBeanServerConnection buildMBeanServerConnection(final String url) {
        try {
            JMXServiceURL jmxServiceURL = urlFactory.createJmxServiceUrl(url);
            JMXConnector c = getJmxConnector(jmxServiceURL);
            return c.getMBeanServerConnection();
        } catch (IOException e) {
            throw new JmxConnectionException("JMX connection to " + url + " cannot be established", e);
        }
    }

}