org.springframework.http.server.reactive.JettyHttpHandlerAdapter Java Examples

The following examples show how to use org.springframework.http.server.reactive.JettyHttpHandlerAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Application.java    From spring-reactive-sample with GNU General Public License v3.0 6 votes vote down vote up
@Bean
public Server jettyServer(ApplicationContext context) throws Exception {
    HttpHandler handler = WebHttpHandlerBuilder.applicationContext(context).build();
    Servlet servlet = new JettyHttpHandlerAdapter(handler);

    Server server = new Server();
    ServletContextHandler contextHandler = new ServletContextHandler(server, "");
    contextHandler.addServlet(new ServletHolder(servlet), "/");
    contextHandler.start();

    ServerConnector connector = new ServerConnector(server);
    connector.setHost("localhost");
    connector.setPort(port);
    server.addConnector(connector);

    return server;
}
 
Example #2
Source File: JettyHttpServer.java    From spring-analysis-note with MIT License 4 votes vote down vote up
private ServletHttpHandlerAdapter createServletAdapter() {
	return new JettyHttpHandlerAdapter(resolveHttpHandler());
}
 
Example #3
Source File: JettyHttpServer.java    From java-technology-stack with MIT License 4 votes vote down vote up
private ServletHttpHandlerAdapter createServletAdapter() {
	return new JettyHttpHandlerAdapter(resolveHttpHandler());
}