protected void doConnect(Map environment) throws IOException, SecurityException
{
JMXServiceURL address = getAddress();
String protocol = address.getProtocol();
ConnectionResolver resolver = ConnectionResolver.newConnectionResolver(protocol, environment);
if (resolver == null) throw new MalformedURLException("Unsupported protocol: " + protocol);
HTTPConnection temp = (HTTPConnection)resolver.lookupClient(address, environment);
connection = (HTTPConnection)resolver.bindClient(temp, environment);
Object credentials = environment == null ? null : environment.get(CREDENTIALS);
connectionId = connection.connect(credentials);
this.heartbeat = createHeartBeat(connection, getConnectionNotificationEmitter(), environment);