Search in sources :

Example 1 with WSFServlet

use of org.jboss.wsf.spi.deployment.WSFServlet in project wildfly by wildfly.

the class EndpointPublisherImpl method addServlets.

private static void addServlets(JBossWebMetaData jbwebMD, WebDeploymentBuilder deployment) {
    for (JBossServletMetaData smd : jbwebMD.getServlets()) {
        final String sc = smd.getServletClass();
        if (sc.equals(WSFServlet.class.getName())) {
            ServletBuilder servletBuilder = new ServletBuilder();
            final String servletName = smd.getServletName();
            List<ParamValueMetaData> params = smd.getInitParam();
            List<String> urlPatterns = null;
            for (ServletMappingMetaData smmd : jbwebMD.getServletMappings()) {
                if (smmd.getServletName().equals(servletName)) {
                    urlPatterns = smmd.getUrlPatterns();
                    servletBuilder.addUrlMappings(urlPatterns);
                    break;
                }
            }
            WSFServlet wsfs = new WSFServlet();
            servletBuilder.setServletName(servletName);
            servletBuilder.setServlet(wsfs);
            servletBuilder.setServletClass(WSFServlet.class);
            for (ParamValueMetaData param : params) {
                servletBuilder.addInitParam(param.getParamName(), param.getParamValue());
            }
            deployment.addServlet(servletBuilder);
        }
    }
}
Also used : ParamValueMetaData(org.jboss.metadata.javaee.spec.ParamValueMetaData) ServletMappingMetaData(org.jboss.metadata.web.spec.ServletMappingMetaData) JBossServletMetaData(org.jboss.metadata.web.jboss.JBossServletMetaData) ServletBuilder(org.jboss.as.web.host.ServletBuilder) WSFServlet(org.jboss.wsf.spi.deployment.WSFServlet)

Aggregations

ServletBuilder (org.jboss.as.web.host.ServletBuilder)1 ParamValueMetaData (org.jboss.metadata.javaee.spec.ParamValueMetaData)1 JBossServletMetaData (org.jboss.metadata.web.jboss.JBossServletMetaData)1 ServletMappingMetaData (org.jboss.metadata.web.spec.ServletMappingMetaData)1 WSFServlet (org.jboss.wsf.spi.deployment.WSFServlet)1