> ACCESSIBLE_SUB_DEPLOYMENTS = AttachmentKey.createList(DeploymentUnit.class);
diff --git a/server/src/main/java/org/jboss/as/server/deployment/Phase.java b/server/src/main/java/org/jboss/as/server/deployment/Phase.java
index 1620df0dc1c..63aa8530daa 100644
--- a/server/src/main/java/org/jboss/as/server/deployment/Phase.java
+++ b/server/src/main/java/org/jboss/as/server/deployment/Phase.java
@@ -85,7 +85,7 @@ public enum Phase {
*
* In this phase, these phase attachments may be modified:
*
- * - {@link Attachments#CLASS_PATH_ENTRIES} - class path entries found in the manifest and elsewhere.
+ * - {@code ManifestClassPathProcessor#CLASS_PATH_MODULES} - class path entries found in the manifest and elsewhere.
* - {@link Attachments#EXTENSION_LIST_ENTRIES} - extension-list entries found in the manifest and elsewhere.
*
*
diff --git a/server/src/main/java/org/jboss/as/server/deployment/module/ManifestClassPathProcessor.java b/server/src/main/java/org/jboss/as/server/deployment/module/ManifestClassPathProcessor.java
index de009d1d7cb..d09c0234c62 100644
--- a/server/src/main/java/org/jboss/as/server/deployment/module/ManifestClassPathProcessor.java
+++ b/server/src/main/java/org/jboss/as/server/deployment/module/ManifestClassPathProcessor.java
@@ -16,6 +16,8 @@
import java.util.jar.Attributes;
import java.util.jar.Manifest;
+import org.jboss.as.server.deployment.AttachmentKey;
+import org.jboss.as.server.deployment.AttachmentList;
import org.jboss.as.server.logging.ServerLogger;
import org.jboss.as.server.deployment.Attachable;
import org.jboss.as.server.deployment.Attachments;
@@ -56,6 +58,11 @@
*/
public final class ManifestClassPathProcessor implements DeploymentUnitProcessor {
+ /**
+ * Module identifiers for Class-Path information.
+ */
+ static final AttachmentKey> CLASS_PATH_MODULES = AttachmentKey.createList(String.class);
+
private static final String[] EMPTY_STRING_ARRAY = {};
/**
@@ -147,7 +154,7 @@ public synchronized void deploy(final DeploymentPhaseContext phaseContext) throw
if (item.startsWith("/")) {
if (externalModuleService.isValidFile(item)) {
final ModuleIdentifier moduleIdentifier = externalModuleService.addExternalModule(item, phaseContext.getServiceRegistry(), externalServiceTarget);
- target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleIdentifier);
+ target.addToAttachmentList(CLASS_PATH_MODULES, moduleIdentifier.toString());
ServerLogger.DEPLOYMENT_LOGGER.debugf("Resource %s added as external jar %s", classPathFile, resourceRoot.getRoot());
} else {
ServerLogger.DEPLOYMENT_LOGGER.classPathEntryNotValid(item, resourceRoot.getRoot().getPathName());
@@ -196,16 +203,16 @@ private void handlingExistingClassPathEntry(final ArrayDeque resource
} else if (additionalModules.containsKey(classPathFile)) {
final AdditionalModuleSpecification moduleSpecification = additionalModules.get(classPathFile);
//as class path entries are exported, transitive dependencies will also be available
- target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleSpecification.getModuleIdentifier());
+ target.addToAttachmentList(CLASS_PATH_MODULES, moduleSpecification.getModuleName());
} else if (subDeployments.containsKey(classPathFile)) {
//now we need to calculate the sub deployment module identifier
//unfortunately the sub deployment has not been setup yet, so we cannot just
//get it from the sub deployment directly
final ResourceRoot otherRoot = subDeployments.get(classPathFile);
- target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, ModuleIdentifierProcessor.createModuleIdentifier(otherRoot.getRootName(), otherRoot, topLevelDeployment, topLevelRoot, false));
+ target.addToAttachmentList(CLASS_PATH_MODULES, ModuleIdentifierProcessor.createModuleIdentifier(otherRoot.getRootName(), otherRoot, topLevelDeployment, topLevelRoot, false).toString());
} else {
ModuleIdentifier identifier = createAdditionalModule(resourceRoot, topLevelDeployment, topLevelRoot, additionalModules, classPathFile, resourceRoots);
- target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, identifier);
+ target.addToAttachmentList(CLASS_PATH_MODULES, identifier.toString());
}
}
diff --git a/server/src/main/java/org/jboss/as/server/deployment/module/ModuleClassPathProcessor.java b/server/src/main/java/org/jboss/as/server/deployment/module/ModuleClassPathProcessor.java
index 9e143e21af1..756d549250c 100644
--- a/server/src/main/java/org/jboss/as/server/deployment/module/ModuleClassPathProcessor.java
+++ b/server/src/main/java/org/jboss/as/server/deployment/module/ModuleClassPathProcessor.java
@@ -13,7 +13,6 @@
import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.DeploymentUnitProcessor;
-import org.jboss.modules.ModuleIdentifier;
import org.jboss.modules.ModuleLoader;
/**
@@ -29,9 +28,9 @@ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentU
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
final ModuleLoader moduleLoader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
- final AttachmentList entries = deploymentUnit.getAttachment(Attachments.CLASS_PATH_ENTRIES);
+ final AttachmentList entries = deploymentUnit.getAttachment(ManifestClassPathProcessor.CLASS_PATH_MODULES);
if (entries != null) {
- for (ModuleIdentifier entry : entries) {
+ for (String entry : entries) {
//class path items are always exported to make transitive dependencies work
moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, entry, false, true, true, false));
}
@@ -40,14 +39,14 @@ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentU
final List additionalModules = deploymentUnit.getAttachment(Attachments.ADDITIONAL_MODULES);
if (additionalModules != null) {
for (AdditionalModuleSpecification additionalModule : additionalModules) {
- final AttachmentList dependencies = additionalModule.getAttachment(Attachments.CLASS_PATH_ENTRIES);
+ final AttachmentList dependencies = additionalModule.getAttachment(ManifestClassPathProcessor.CLASS_PATH_MODULES);
if (dependencies == null || dependencies.isEmpty()) {
continue;
}
// additional modules export any class-path entries
// this means that a module that references the additional module
// gets access to the transitive closure of its call-path entries
- for (ModuleIdentifier entry : dependencies) {
+ for (String entry : dependencies) {
additionalModule.addLocalDependency(new ModuleDependency(moduleLoader, entry, false, true, true, false));
}
// add a dependency on the top ear itself for good measure