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);
}
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;
}
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;
}
Aggregations