Search in sources :

Example 1 with PublishLocationAdapter

use of org.jboss.wsf.spi.metadata.j2ee.PublishLocationAdapter in project wildfly by wildfly.

the class AbstractMetaDataBuilderEJB method buildWebservicesMetaData.

/**
     * Builds webservices meta data. This methods sets:
     * <ul>
     *   <li>context root</li>
     *   <li>wsdl location resolver</li>
     *   <li>config name</li>
     *   <li>config file</li>
     * </ul>
     *
     * @param dep webservice deployment
     * @param ejbArchiveMD universal EJB meta data model
     */
private void buildWebservicesMetaData(final Deployment dep, final EJBArchiveMetaData.Builder ejbArchiveMDBuilder) {
    final JBossWebservicesMetaData webservicesMD = WSHelper.getOptionalAttachment(dep, JBossWebservicesMetaData.class);
    if (webservicesMD == null)
        return;
    // set context root
    final String contextRoot = webservicesMD.getContextRoot();
    ejbArchiveMDBuilder.setWebServiceContextRoot(contextRoot);
    WSLogger.ROOT_LOGGER.tracef("Setting context root: %s", contextRoot);
    // set config name
    final String configName = webservicesMD.getConfigName();
    ejbArchiveMDBuilder.setConfigName(configName);
    WSLogger.ROOT_LOGGER.tracef("Setting config name: %s", configName);
    // set config file
    final String configFile = webservicesMD.getConfigFile();
    ejbArchiveMDBuilder.setConfigFile(configFile);
    WSLogger.ROOT_LOGGER.tracef("Setting config file: %s", configFile);
    // set wsdl location resolver
    final JBossWebserviceDescriptionMetaData[] wsDescriptionsMD = webservicesMD.getWebserviceDescriptions();
    final PublishLocationAdapter resolver = new PublishLocationAdapterImpl(wsDescriptionsMD);
    ejbArchiveMDBuilder.setPublishLocationAdapter(resolver);
}
Also used : PublishLocationAdapter(org.jboss.wsf.spi.metadata.j2ee.PublishLocationAdapter) JBossWebserviceDescriptionMetaData(org.jboss.wsf.spi.metadata.webservices.JBossWebserviceDescriptionMetaData) JBossWebservicesMetaData(org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData)

Example 2 with PublishLocationAdapter

use of org.jboss.wsf.spi.metadata.j2ee.PublishLocationAdapter in project wildfly by wildfly.

the class AbstractMetaDataBuilderPOJO method create.

/**
     * Builds universal JSE meta data model that is AS agnostic.
     *
     * @param dep webservice deployment
     * @return universal JSE meta data model
     */
JSEArchiveMetaData create(final Deployment dep) {
    if (WSLogger.ROOT_LOGGER.isTraceEnabled()) {
        WSLogger.ROOT_LOGGER.tracef("Creating JBoss agnostic meta data for POJO webservice deployment: %s", dep.getSimpleName());
    }
    final JBossWebMetaData jbossWebMD = WSHelper.getRequiredAttachment(dep, JBossWebMetaData.class);
    final DeploymentUnit unit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class);
    final List<POJOEndpoint> pojoEndpoints = getPojoEndpoints(unit);
    final JSEArchiveMetaData.Builder builder = new JSEArchiveMetaData.Builder();
    // set context root
    final String contextRoot = getContextRoot(dep, jbossWebMD);
    builder.setContextRoot(contextRoot);
    WSLogger.ROOT_LOGGER.tracef("Setting context root: %s", contextRoot);
    // set servlet url patterns mappings
    final Map<String, String> servletMappings = getServletUrlPatternsMappings(jbossWebMD, pojoEndpoints);
    builder.setServletMappings(servletMappings);
    // set servlet class names mappings
    final Map<String, String> servletClassNamesMappings = getServletClassMappings(jbossWebMD, pojoEndpoints);
    builder.setServletClassNames(servletClassNamesMappings);
    // set security domain
    final String securityDomain = jbossWebMD.getSecurityDomain();
    builder.setSecurityDomain(securityDomain);
    // set wsdl location resolver
    final JBossWebservicesMetaData jbossWebservicesMD = WSHelper.getOptionalAttachment(dep, JBossWebservicesMetaData.class);
    if (jbossWebservicesMD != null) {
        final PublishLocationAdapter resolver = new PublishLocationAdapterImpl(jbossWebservicesMD.getWebserviceDescriptions());
        builder.setPublishLocationAdapter(resolver);
    }
    // set security meta data
    final List<JSESecurityMetaData> jseSecurityMDs = getSecurityMetaData(jbossWebMD.getSecurityConstraints());
    builder.setSecurityMetaData(jseSecurityMDs);
    // set config name and file
    setConfigNameAndFile(builder, jbossWebMD, jbossWebservicesMD);
    return builder.build();
}
Also used : JBossWebMetaData(org.jboss.metadata.web.jboss.JBossWebMetaData) PublishLocationAdapter(org.jboss.wsf.spi.metadata.j2ee.PublishLocationAdapter) POJOEndpoint(org.jboss.as.webservices.metadata.model.POJOEndpoint) JSESecurityMetaData(org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData) JSEArchiveMetaData(org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData) JBossWebservicesMetaData(org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Aggregations

PublishLocationAdapter (org.jboss.wsf.spi.metadata.j2ee.PublishLocationAdapter)2 JBossWebservicesMetaData (org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData)2 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 POJOEndpoint (org.jboss.as.webservices.metadata.model.POJOEndpoint)1 JBossWebMetaData (org.jboss.metadata.web.jboss.JBossWebMetaData)1 JSEArchiveMetaData (org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData)1 JSESecurityMetaData (org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData)1 JBossWebserviceDescriptionMetaData (org.jboss.wsf.spi.metadata.webservices.JBossWebserviceDescriptionMetaData)1