Search in sources :

Example 21 with JBossWebMetaData

use of org.jboss.metadata.web.jboss.JBossWebMetaData in project wildfly by wildfly.

the class AbstractDeploymentModelBuilder method propagateAttachments.

private void propagateAttachments(final DeploymentUnit unit, final ArchiveDeployment dep) {
    dep.addAttachment(DeploymentUnit.class, unit);
    unit.putAttachment(DEPLOYMENT_KEY, dep);
    final JBossWebMetaData webMD = getJBossWebMetaData(unit);
    dep.addAttachment(JBossWebMetaData.class, webMD);
    final WebservicesMetaData webservicesMD = getOptionalAttachment(unit, WEBSERVICES_METADATA_KEY);
    dep.addAttachment(WebservicesMetaData.class, webservicesMD);
    JBossWebservicesMetaData jbossWebservicesMD = getOptionalAttachment(unit, JBOSS_WEBSERVICES_METADATA_KEY);
    if (unit.getParent() != null) {
        jbossWebservicesMD = JBossWebservicesMetaData.merge(getOptionalAttachment(unit.getParent(), JBOSS_WEBSERVICES_METADATA_KEY), jbossWebservicesMD);
    }
    dep.addAttachment(JBossWebservicesMetaData.class, jbossWebservicesMD);
    final JAXWSDeployment jaxwsDeployment = getOptionalAttachment(unit, JAXWS_ENDPOINTS_KEY);
    dep.addAttachment(JAXWSDeployment.class, jaxwsDeployment);
    final EjbJarMetaData ejbJarMD = getOptionalAttachment(unit, EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
    dep.addAttachment(EjbJarMetaData.class, ejbJarMD);
    final RejectionRule rr = getOptionalAttachment(unit, REJECTION_RULE_KEY);
    if (rr != null) {
        dep.addAttachment(RejectionRule.class, rr);
    }
}
Also used : JBossWebMetaData(org.jboss.metadata.web.jboss.JBossWebMetaData) ASHelper.getJBossWebMetaData(org.jboss.as.webservices.util.ASHelper.getJBossWebMetaData) RejectionRule(org.jboss.wsf.spi.invocation.RejectionRule) EjbJarMetaData(org.jboss.metadata.ejb.spec.EjbJarMetaData) JBossWebservicesMetaData(org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData) JBossWebservicesMetaData(org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData) WebservicesMetaData(org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData) JAXWSDeployment(org.jboss.as.webservices.metadata.model.JAXWSDeployment)

Example 22 with JBossWebMetaData

use of org.jboss.metadata.web.jboss.JBossWebMetaData in project wildfly by wildfly.

the class EndpointService method getDeploymentSecurityDomainName.

private static String getDeploymentSecurityDomainName(final Endpoint ep) {
    JBossWebMetaData metadata = ep.getService().getDeployment().getAttachment(JBossWebMetaData.class);
    String metaDataSecurityDomain = metadata != null ? metadata.getSecurityDomain() : null;
    return metaDataSecurityDomain == null ? SecurityConstants.DEFAULT_APPLICATION_POLICY : SecurityUtil.unprefixSecurityDomain(metaDataSecurityDomain.trim());
}
Also used : JBossWebMetaData(org.jboss.metadata.web.jboss.JBossWebMetaData)

Example 23 with JBossWebMetaData

use of org.jboss.metadata.web.jboss.JBossWebMetaData in project wildfly by wildfly.

the class MetaDataBuilderJAXWS_EJB method buildEnterpriseBeansMetaData.

@Override
protected void buildEnterpriseBeansMetaData(final Deployment dep, final EJBArchiveMetaData.Builder ejbArchiveMDBuilder) {
    if (!WSHelper.isJaxwsJseDeployment(dep)) {
        // [AS7-1605] support
        final JBossWebMetaData jbossWebMD = WSHelper.getOptionalAttachment(dep, JBossWebMetaData.class);
        final String contextRoot = getContextRoot(dep, jbossWebMD);
        if (contextRoot != null) {
            final JSEArchiveMetaData.Builder jseArchiveMDBuilder = new JSEArchiveMetaData.Builder();
            jseArchiveMDBuilder.setContextRoot(contextRoot);
            dep.addAttachment(JSEArchiveMetaData.class, jseArchiveMDBuilder.build());
        }
    }
    final JAXWSDeployment jaxwsDeployment = WSHelper.getRequiredAttachment(dep, JAXWSDeployment.class);
    final List<EJBMetaData> wsEjbsMD = new LinkedList<EJBMetaData>();
    final JBossWebservicesMetaData jbossWebservicesMD = WSHelper.getOptionalAttachment(dep, JBossWebservicesMetaData.class);
    for (final EJBEndpoint jbossEjbMD : jaxwsDeployment.getEjbEndpoints()) {
        buildEnterpriseBeanMetaData(wsEjbsMD, jbossEjbMD, jbossWebservicesMD);
    }
    ejbArchiveMDBuilder.setEnterpriseBeans(wsEjbsMD);
}
Also used : EJBMetaData(org.jboss.wsf.spi.metadata.j2ee.EJBMetaData) JBossWebMetaData(org.jboss.metadata.web.jboss.JBossWebMetaData) JSEArchiveMetaData(org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData) JBossWebservicesMetaData(org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData) EJBEndpoint(org.jboss.as.webservices.metadata.model.EJBEndpoint) JAXWSDeployment(org.jboss.as.webservices.metadata.model.JAXWSDeployment) LinkedList(java.util.LinkedList)

Example 24 with JBossWebMetaData

use of org.jboss.metadata.web.jboss.JBossWebMetaData 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());
        ServerConfigService config = (ServerConfigService) unit.getServiceRegistry().getService(WSServices.CONFIG_SERVICE).getService();
        File docBase = new File(config.getValue().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) ServerConfigService(org.jboss.as.webservices.service.ServerConfigService) 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)

Example 25 with JBossWebMetaData

use of org.jboss.metadata.web.jboss.JBossWebMetaData in project wildfly by wildfly.

the class ASHelper method getJBossWebMetaData.

/**
     * Gets the JBossWebMetaData from the WarMetaData attached to the provided deployment unit, if any.
     *
     * @param unit
     * @return the JBossWebMetaData or null if either that or the parent WarMetaData are not found.
     */
public static JBossWebMetaData getJBossWebMetaData(final DeploymentUnit unit) {
    final WarMetaData warMetaData = getOptionalAttachment(unit, WarMetaData.ATTACHMENT_KEY);
    JBossWebMetaData result = null;
    if (warMetaData != null) {
        result = warMetaData.getMergedJBossWebMetaData();
        if (result == null) {
            result = warMetaData.getJBossWebMetaData();
        }
    } else {
        result = getOptionalAttachment(unit, WSAttachmentKeys.JBOSSWEB_METADATA_KEY);
    }
    return result;
}
Also used : JBossWebMetaData(org.jboss.metadata.web.jboss.JBossWebMetaData) WarMetaData(org.jboss.as.web.common.WarMetaData)

Aggregations

JBossWebMetaData (org.jboss.metadata.web.jboss.JBossWebMetaData)25 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)14 WarMetaData (org.jboss.as.web.common.WarMetaData)14 DeploymentUnitProcessingException (org.jboss.as.server.deployment.DeploymentUnitProcessingException)7 ParamValueMetaData (org.jboss.metadata.javaee.spec.ParamValueMetaData)6 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)5 HashSet (java.util.HashSet)5 ResourceRoot (org.jboss.as.server.deployment.module.ResourceRoot)5 JBossServletMetaData (org.jboss.metadata.web.jboss.JBossServletMetaData)5 VirtualFile (org.jboss.vfs.VirtualFile)4 JBossWebservicesMetaData (org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData)4 EEModuleDescription (org.jboss.as.ee.component.EEModuleDescription)3 EJBEndpoint (org.jboss.as.webservices.metadata.model.EJBEndpoint)3 POJOEndpoint (org.jboss.as.webservices.metadata.model.POJOEndpoint)3 ListenerMetaData (org.jboss.metadata.web.spec.ListenerMetaData)3 Module (org.jboss.modules.Module)3 IOException (java.io.IOException)2 LinkedList (java.util.LinkedList)2 WebService (javax.jws.WebService)2