use of org.jboss.ws.common.ResourceLoaderAdapter 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;
}
Aggregations