JMXServiceURL address = getAddress();
String protocol = address.getProtocol();
ConnectionResolver resolver = ConnectionResolver.newConnectionResolver(protocol, environment);
if (resolver == null) throw new MalformedURLException("Unsupported protocol: " + protocol);
ConnectionManager server = (ConnectionManager)resolver.lookupClient(address, environment);
server = (ConnectionManager)resolver.bindClient(server, environment);
Object credentials = environment == null ? null : environment.get(CREDENTIALS);
connection = server.connect(credentials);
}