use of org.eclipse.jetty.server.handler.HandlerList in project killbill by killbill.
the class HttpServer method configure.
public void configure(final HttpServerConfig config, final Iterable<EventListener> eventListeners, final Map<FilterHolder, String> filterHolders) {
server.setStopAtShutdown(true);
// Setup JMX
configureJMX(ManagementFactory.getPlatformMBeanServer());
// HTTP Configuration
final HttpConfiguration httpConfiguration = new HttpConfiguration();
httpConfiguration.setSecurePort(config.getServerSslPort());
// Configure main connector
final ServerConnector http = configureMainConnector(httpConfiguration, config.isJettyStatsOn(), config.getServerHost(), config.getServerPort());
// Configure SSL, if enabled
final ServerConnector https;
if (config.isSSLEnabled()) {
https = configureSslConnector(httpConfiguration, config.isJettyStatsOn(), config.getServerSslPort(), config.getSSLkeystoreLocation(), config.getSSLkeystorePassword());
server.setConnectors(new Connector[] { http, https });
} else {
server.setConnectors(new Connector[] { http });
}
// Configure the thread pool
configureThreadPool(config);
// Configure handlers
final HandlerCollection handlers = new HandlerCollection();
final ServletContextHandler servletContextHandler = createServletContextHandler(config.getResourceBase(), eventListeners, filterHolders);
handlers.addHandler(servletContextHandler);
final RequestLogHandler logHandler = createLogHandler(config);
handlers.addHandler(logHandler);
final HandlerList rootHandlers = new HandlerList();
rootHandlers.addHandler(handlers);
server.setHandler(rootHandlers);
}
Aggregations