@Override
public boolean startConnection() {
HttpClientStarter httpstarter = getLevel().find(HttpClientStarter.class);
if (!httpstarter.isStarted()) {
return false;
}
try {
String protocol = ssl ? "https" : "http";
int resolvedport = port > 0 ? port : ssl ? 443 : 80;
URL url = new URL(protocol, getHostName(), resolvedport, path);
j4pClient = new J4pClient(url.toString(), httpstarter.getHttpClient());
connection = new JolokiaJmxSource(j4pClient);
return true;
} catch (MalformedURLException e) {
log(Level.ERROR, e, "can't build jolokia URL: %s", e.getMessage());
return false;
}
}