Search in sources :

Example 1 with AllowWSRequestPredicate

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;
}
Also used : JBossWebMetaData(org.jboss.metadata.web.jboss.JBossWebMetaData) AllowWSRequestPredicate(org.jboss.as.webservices.deployers.AllowWSRequestPredicate) WebDeploymentBuilder(org.jboss.as.web.host.WebDeploymentBuilder) WebDeploymentController(org.jboss.as.web.host.WebDeploymentController) File(java.io.File)

Aggregations

File (java.io.File)1 WebDeploymentBuilder (org.jboss.as.web.host.WebDeploymentBuilder)1 WebDeploymentController (org.jboss.as.web.host.WebDeploymentController)1 AllowWSRequestPredicate (org.jboss.as.webservices.deployers.AllowWSRequestPredicate)1 JBossWebMetaData (org.jboss.metadata.web.jboss.JBossWebMetaData)1