Search in sources :

Example 1 with RestartingHandler

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;
}
Also used : ServerConnector(org.eclipse.jetty.server.ServerConnector) ServerConnector(org.eclipse.jetty.server.ServerConnector) Connector(org.eclipse.jetty.server.Connector) HandlerCollection(org.eclipse.jetty.server.handler.HandlerCollection) RestartingHandler(io.leopard.myjetty.webapp.RestartingHandler)

Aggregations

RestartingHandler (io.leopard.myjetty.webapp.RestartingHandler)1 Connector (org.eclipse.jetty.server.Connector)1 ServerConnector (org.eclipse.jetty.server.ServerConnector)1 HandlerCollection (org.eclipse.jetty.server.handler.HandlerCollection)1