throw new Fault(new Message("START_UP_SERVER_FAILED_MSG", LOG, e.getMessage()), e);
}
}
String contextName = HttpUriMapper.getContextName(url.getPath());
ContextHandler context = new ContextHandler();
context.setContextPath(contextName);
// bind the jetty http handler with the context handler
context.setHandler(handler);
if (isSessionSupport) {
HashSessionManager sessionManager = new HashSessionManager();
SessionHandler sessionHandler = new SessionHandler(sessionManager);
HashSessionIdManager idManager = new HashSessionIdManager();
sessionManager.setIdManager(idManager);
context.addHandler(sessionHandler);
}
contexts.addHandler(context);
ServletContext sc = context.getServletContext();
handler.setServletContext(sc);
final String smap = HttpUriMapper.getResourceBase(url.getPath());
handler.setName(smap);
if (contexts.isStarted()) {
try {
context.start();
} catch (Exception ex) {
LOG.log(Level.WARNING, "ADD_HANDLER_FAILED_MSG", new Object[] {ex.getMessage()});
}
}