}
}
// TODO: Add connector to a pool and release it on demand. For now, simply close it.
private JMXConnector getConnector(JmxRequest pJmxReq) throws IOException {
ProxyTargetConfig targetConfig = pJmxReq.getTargetConfig();
if (targetConfig == null) {
throw new IllegalArgumentException("No proxy configuration in request " + pJmxReq);
}
String urlS = targetConfig.getUrl();
JMXServiceURL url = new JMXServiceURL(urlS);
Map<String,Object> env = prepareEnv(targetConfig.getEnv());
JMXConnector ret = JMXConnectorFactory.newJMXConnector(url,env);
ret.connect();
return ret;
}