use of io.leopard.myjetty.webapp.RestartingHandler in project leopard by tanhaichao.
the class MyJettyServer method start.
public Server start(int port) throws Exception {
System.setProperty("spring.profiles.active", "jetty");
List<ServerConnector> connectorList = this.listPort(port);
Connector[] connectors = new Connector[connectorList.size()];
connectorList.toArray(connectors);
server.setConnectors(connectors);
HandlerCollection handlers = new HandlerCollection();
// webappService.addHandler(new WorkbenchHandler(server));//TODO
handlers.addHandler(webappService.getContextHandlerCollection());
new HandlerServiceImpl().execute(handlers);
handlers.addHandler(new RestartingHandler());
server.setHandler(handlers);
System.out.println("started");
logger.info("jetty started");
server.start();
return server;
}
Aggregations