Search in sources :

Example 1 with UnifiedVirtualFile

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

the class VirtualFileAdaptor method findChild.

private UnifiedVirtualFile findChild(String child, boolean throwExceptionIfNotFound) throws IOException {
    final VirtualFile virtualFile = getFile();
    final VirtualFile childFile = file.getChild(child);
    if (!childFile.exists()) {
        if (throwExceptionIfNotFound) {
            throw WSLogger.ROOT_LOGGER.missingChild(child, virtualFile);
        } else {
            WSLogger.ROOT_LOGGER.tracef("Child '%s' not found for VirtualFile: %s", child, virtualFile);
            return null;
        }
    }
    return new VirtualFileAdaptor(childFile);
}
Also used : UnifiedVirtualFile(org.jboss.wsf.spi.deployment.UnifiedVirtualFile) VirtualFile(org.jboss.vfs.VirtualFile)

Example 2 with UnifiedVirtualFile

use of org.jboss.wsf.spi.deployment.UnifiedVirtualFile 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)

Example 3 with UnifiedVirtualFile

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

the class VirtualFileAdaptor method getChildren.

public List<UnifiedVirtualFile> getChildren() throws IOException {
    List<VirtualFile> vfList = getFile().getChildren();
    if (vfList == null)
        return null;
    List<UnifiedVirtualFile> uvfList = new LinkedList<UnifiedVirtualFile>();
    for (VirtualFile vf : vfList) {
        uvfList.add(new VirtualFileAdaptor(vf));
    }
    return uvfList;
}
Also used : UnifiedVirtualFile(org.jboss.wsf.spi.deployment.UnifiedVirtualFile) VirtualFile(org.jboss.vfs.VirtualFile) UnifiedVirtualFile(org.jboss.wsf.spi.deployment.UnifiedVirtualFile) LinkedList(java.util.LinkedList)

Aggregations

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