final String contextPath = pConfig.getContextPath();
jolokiaHttpHandler = new JolokiaHttpHandler(pConfig.getJolokiaConfig());
HttpContext context = pServer.createContext(contextPath, jolokiaHttpHandler);
// Add authentication if configured
final Authenticator authenticator = pConfig.getAuthenticator();
if (authenticator != null) {
context.setAuthenticator(authenticator);
}
url = detectAgentUrl(pServer, pConfig, contextPath);