Search in sources :

Example 1 with ArchiveDeployment

use of org.jboss.wsf.spi.deployment.ArchiveDeployment in project wildfly by wildfly.

the class AbstractDeploymentModelBuilder method newDeploymentModel.

/**
     * @see org.jboss.webservices.integration.deployers.deployment.DeploymentModelBuilder#newDeploymentModel(DeploymentUnit)
     *
     * @param unit deployment unit
     */
public final void newDeploymentModel(final DeploymentUnit unit) {
    final ArchiveDeployment dep;
    if (unit.hasAttachment(DEPLOYMENT_KEY)) {
        dep = (ArchiveDeployment) unit.getAttachment(DEPLOYMENT_KEY);
    } else {
        dep = newDeployment(unit);
        propagateAttachments(unit, dep);
    }
    this.build(dep, unit);
}
Also used : ArchiveDeployment(org.jboss.wsf.spi.deployment.ArchiveDeployment)

Example 2 with ArchiveDeployment

use of org.jboss.wsf.spi.deployment.ArchiveDeployment in project wildfly by wildfly.

the class AbstractDeploymentModelBuilder method newDeployment.

/**
     * Creates new Web Service deployment.
     *
     * @param unit deployment unit
     * @return archive deployment
     */
private ArchiveDeployment newDeployment(final DeploymentUnit unit) {
    WSLogger.ROOT_LOGGER.tracef("Creating new unified WS deployment model for %s", unit);
    final ResourceRoot deploymentRoot = unit.getAttachment(Attachments.DEPLOYMENT_ROOT);
    final VirtualFile root = deploymentRoot != null ? deploymentRoot.getRoot() : null;
    final ClassLoader classLoader;
    final Module module = unit.getAttachment(Attachments.MODULE);
    if (module == null) {
        classLoader = unit.getAttachment(CLASSLOADER_KEY);
        if (classLoader == null) {
            throw WSLogger.ROOT_LOGGER.classLoaderResolutionFailed(unit);
        }
    } else {
        classLoader = module.getClassLoader();
    }
    ArchiveDeployment parentDep = null;
    if (unit.getParent() != null) {
        final Module parentModule = unit.getParent().getAttachment(Attachments.MODULE);
        if (parentModule == null) {
            throw WSLogger.ROOT_LOGGER.classLoaderResolutionFailed(deploymentRoot);
        }
        WSLogger.ROOT_LOGGER.tracef("Creating new unified WS deployment model for %s", unit.getParent());
        parentDep = this.newDeployment(null, unit.getParent().getName(), parentModule.getClassLoader(), null);
    }
    final UnifiedVirtualFile uvf = root != null ? new VirtualFileAdaptor(root) : new ResourceLoaderAdapter(classLoader);
    final ArchiveDeployment dep = this.newDeployment(parentDep, unit.getName(), classLoader, uvf);
    //add an AnnotationInfo attachment that uses composite jandex index
    dep.addAttachment(AnnotationsInfo.class, new JandexAnnotationsInfo(unit));
    return dep;
}
Also used : VirtualFile(org.jboss.vfs.VirtualFile) UnifiedVirtualFile(org.jboss.wsf.spi.deployment.UnifiedVirtualFile) ResourceRoot(org.jboss.as.server.deployment.module.ResourceRoot) ArchiveDeployment(org.jboss.wsf.spi.deployment.ArchiveDeployment) UnifiedVirtualFile(org.jboss.wsf.spi.deployment.UnifiedVirtualFile) VirtualFileAdaptor(org.jboss.as.webservices.util.VirtualFileAdaptor) ResourceLoaderAdapter(org.jboss.ws.common.ResourceLoaderAdapter) Module(org.jboss.modules.Module)

Aggregations

ArchiveDeployment (org.jboss.wsf.spi.deployment.ArchiveDeployment)2 ResourceRoot (org.jboss.as.server.deployment.module.ResourceRoot)1 VirtualFileAdaptor (org.jboss.as.webservices.util.VirtualFileAdaptor)1 Module (org.jboss.modules.Module)1 VirtualFile (org.jboss.vfs.VirtualFile)1 ResourceLoaderAdapter (org.jboss.ws.common.ResourceLoaderAdapter)1 UnifiedVirtualFile (org.jboss.wsf.spi.deployment.UnifiedVirtualFile)1