Search in sources :

Example 1 with JSAPIServlet

use of org.openremote.container.web.jsapi.JSAPIServlet in project openremote by openremote.

the class WebService method createJsApiHandler.

protected HttpHandler createJsApiHandler(IdentityService identityService, ResteasyDeployment resteasyDeployment) {
    if (resteasyDeployment == null)
        return null;
    ServletInfo jsApiServlet = Servlets.servlet("RESTEasy JS Servlet", JSAPIServlet.class).setAsyncSupported(true).setLoadOnStartup(1).addMapping("/*");
    DeploymentInfo deploymentInfo = new DeploymentInfo().setDeploymentName("RESTEasy JS Deployment").setContextPath(JSAPI_PATH).addServlet(jsApiServlet).setClassLoader(Container.class.getClassLoader());
    deploymentInfo.addServletContextAttribute(ResteasyContextParameters.RESTEASY_DEPLOYMENTS, new HashMap<String, ResteasyDeployment>() {

        {
            put("", resteasyDeployment);
        }
    });
    return addServletDeployment(identityService, deploymentInfo, false);
}
Also used : ServletInfo(io.undertow.servlet.api.ServletInfo) ResteasyDeployment(org.jboss.resteasy.spi.ResteasyDeployment) Container(org.openremote.container.Container) HttpString(io.undertow.util.HttpString) DeploymentInfo(io.undertow.servlet.api.DeploymentInfo) JSAPIServlet(org.openremote.container.web.jsapi.JSAPIServlet)

Aggregations

DeploymentInfo (io.undertow.servlet.api.DeploymentInfo)1 ServletInfo (io.undertow.servlet.api.ServletInfo)1 HttpString (io.undertow.util.HttpString)1 ResteasyDeployment (org.jboss.resteasy.spi.ResteasyDeployment)1 Container (org.openremote.container.Container)1 JSAPIServlet (org.openremote.container.web.jsapi.JSAPIServlet)1