use of org.jboss.as.webservices.deployers.AllowWSRequestPredicate in project wildfly by wildfly.
the class EndpointPublisherImpl method startWebApp.
private static WebDeploymentController startWebApp(WebHost host, DeploymentUnit unit) throws Exception {
WebDeploymentBuilder deployment = new WebDeploymentBuilder();
WebDeploymentController handle;
try {
JBossWebMetaData jbwebMD = unit.getAttachment(WSAttachmentKeys.JBOSSWEB_METADATA_KEY);
deployment.setContextRoot(jbwebMD.getContextRoot());
File docBase = new File(ServerConfigFactoryImpl.getConfig().getServerTempDir(), jbwebMD.getContextRoot());
if (!docBase.exists()) {
docBase.mkdirs();
}
deployment.setDocumentRoot(docBase);
deployment.setClassLoader(unit.getAttachment(WSAttachmentKeys.CLASSLOADER_KEY));
deployment.addAllowedRequestPredicate(new AllowWSRequestPredicate());
addServlets(jbwebMD, deployment);
handle = host.addWebDeployment(deployment);
handle.create();
} catch (Exception e) {
throw WSLogger.ROOT_LOGGER.createContextPhaseFailed(e);
}
try {
handle.start();
} catch (Exception e) {
throw WSLogger.ROOT_LOGGER.startContextPhaseFailed(e);
}
return handle;
}
Aggregations