Author: asoldano
Date: 2014-06-12 12:04:01 -0400 (Thu, 12 Jun 2014)
New Revision: 18729
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
Log:
[JBWS-3793] More cleanup
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2014-06-12
16:04:00 UTC (rev 18728)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2014-06-12
16:04:01 UTC (rev 18729)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -50,6 +50,7 @@
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointType;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -184,27 +185,20 @@
} else {
classLoader = module.getClassLoader();
}
- final ArchiveDeployment dep = this.newDeployment(unit.getName(), classLoader);
-
+
+ ArchiveDeployment parentDep = null;
if (unit.getParent() != null) {
- final String parentDeploymentName = unit.getParent().getName();
final Module parentModule =
unit.getParent().getAttachment(Attachments.MODULE);
if (parentModule == null) {
throw MESSAGES.classLoaderResolutionFailed(deploymentRoot);
}
- final ClassLoader parentClassLoader = parentModule.getClassLoader();
-
ROOT_LOGGER.creatingUnifiedWebservicesDeploymentModel(unit.getParent());
- final ArchiveDeployment parentDep = this.newDeployment(parentDeploymentName,
parentClassLoader);
- dep.setParent(parentDep);
+ 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);
- if (root != null) {
- dep.setRootFile(new VirtualFileAdaptor(root));
- } else {
- dep.setRootFile(new ResourceLoaderAdapter(classLoader));
- }
- dep.setRuntimeClassLoader(classLoader);
//add an AnnotationInfo attachment that uses composite jandex index
dep.addAttachment(AnnotationsInfo.class, new JandexAnnotationsInfo(unit));
@@ -218,7 +212,11 @@
* @param loader deployment loader
* @return new archive deployment
*/
- private ArchiveDeployment newDeployment(final String name, final ClassLoader loader)
{
- return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(name,
loader);
+ private ArchiveDeployment newDeployment(final ArchiveDeployment parent, final String
name, final ClassLoader loader, final UnifiedVirtualFile rootFile) {
+ if (parent != null) {
+ return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(parent, name,
loader, rootFile);
+ } else {
+ return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(name, loader,
rootFile);
+ }
}
}