use of io.undertow.servlet.api.ServletInfo in project wildfly by wildfly.
the class WebHostService method addWebDeployment.
@Override
public WebDeploymentController addWebDeployment(final WebDeploymentBuilder webDeploymentBuilder) throws Exception {
DeploymentInfo d = new DeploymentInfo();
d.setDeploymentName(webDeploymentBuilder.getContextRoot());
d.setContextPath(webDeploymentBuilder.getContextRoot());
d.setClassLoader(webDeploymentBuilder.getClassLoader());
d.setResourceManager(new FileResourceManager(webDeploymentBuilder.getDocumentRoot().getCanonicalFile(), 1024 * 1024));
d.setIgnoreFlush(false);
for (ServletBuilder servlet : webDeploymentBuilder.getServlets()) {
ServletInfo s;
if (servlet.getServlet() == null) {
s = new ServletInfo(servlet.getServletName(), (Class<? extends Servlet>) servlet.getServletClass());
} else {
s = new ServletInfo(servlet.getServletName(), (Class<? extends Servlet>) servlet.getServletClass(), new ImmediateInstanceFactory<>(servlet.getServlet()));
}
if (servlet.isForceInit()) {
s.setLoadOnStartup(1);
}
s.addMappings(servlet.getUrlMappings());
for (Map.Entry<String, String> param : servlet.getInitParams().entrySet()) {
s.addInitParam(param.getKey(), param.getValue());
}
d.addServlet(s);
}
if (controlPoint != null) {
d.addOuterHandlerChainWrapper(GlobalRequestControllerHandler.wrapper(controlPoint, webDeploymentBuilder.getAllowRequestPredicates()));
}
return new WebDeploymentControllerImpl(d);
}
use of io.undertow.servlet.api.ServletInfo in project indy by Commonjava.
the class DotMavenDeploymentProvider method getDeploymentInfo.
@Override
public DeploymentInfo getDeploymentInfo() {
final ServletInfo servletInfo = Servlets.servlet("DotMaven", DotMavenServlet.class).setAsyncSupported(true).setLoadOnStartup(3).addMapping("/mavdav*").addMapping("/mavdav/*");
servletInfo.setInstanceFactory(new ImmediateInstanceFactory<Servlet>(servlet));
return new DeploymentInfo().addServlet(servletInfo);
}
Aggregations