Search in sources :

Example 1 with ServletContainerImpl

use of io.undertow.servlet.core.ServletContainerImpl in project cxf by apache.

the class UndertowHTTPServerEngine method buildServletContext.

private ServletContext buildServletContext(String contextName) throws ServletException {
    ServletContainer servletContainer = new ServletContainerImpl();
    DeploymentInfo deploymentInfo = new DeploymentInfo();
    deploymentInfo.setClassLoader(Thread.currentThread().getContextClassLoader());
    deploymentInfo.setDeploymentName("cxf-undertow");
    deploymentInfo.setContextPath(contextName);
    ServletInfo asyncServlet = new ServletInfo(ServletPathMatches.DEFAULT_SERVLET_NAME, CxfUndertowServlet.class);
    deploymentInfo.addServlet(asyncServlet);
    servletContainer.addDeployment(deploymentInfo);
    DeploymentManager deploymentManager = servletContainer.getDeployment(deploymentInfo.getDeploymentName());
    deploymentManager.deploy();
    deploymentManager.start();
    return deploymentManager.getDeployment().getServletContext();
}
Also used : ServletInfo(io.undertow.servlet.api.ServletInfo) DeploymentManager(io.undertow.servlet.api.DeploymentManager) ServletContainer(io.undertow.servlet.api.ServletContainer) ServletContainerImpl(io.undertow.servlet.core.ServletContainerImpl) DeploymentInfo(io.undertow.servlet.api.DeploymentInfo)

Aggregations

DeploymentInfo (io.undertow.servlet.api.DeploymentInfo)1 DeploymentManager (io.undertow.servlet.api.DeploymentManager)1 ServletContainer (io.undertow.servlet.api.ServletContainer)1 ServletInfo (io.undertow.servlet.api.ServletInfo)1 ServletContainerImpl (io.undertow.servlet.core.ServletContainerImpl)1