run(options.isJointServerThread());
}
public void run(boolean join) throws Exception {
System.setProperty("org.eclipse.jetty.util.log.class", Slf4jLog.class.getName());
Slf4jLog log = new Slf4jLog("jetty");
Log.setLog(log);
WebAppContext webapp = new WebAppContext();
webapp.setContextPath(options.getContextPath());
String war = findWar(options.getWarLocation());
if (war == null) {
war = options.getWar();
}
if (war == null) {
throw new IllegalArgumentException("No war or warLocation options set!");
}
webapp.setWar(war);
webapp.setParentLoaderPriority(true);
webapp.setLogUrlOnStart(true);
webapp.setExtraClasspath(options.getExtraClassPath());
// lets set a temporary directory so jetty doesn't bork if some process zaps /tmp/*
String homeDir = System.getProperty("user.home", ".") + System.getProperty("hawtio.dirname", "/.hawtio");
String tempDirPath = homeDir + "/tmp";
File tempDir = new File(tempDirPath);
tempDir.mkdirs();
log.info("using temp directory for jetty: " + tempDir.getPath());
webapp.setTempDirectory(tempDir);
Server server = new Server(options.getPort());
server.setHandler(webapp);