embeddedArchive.setParentArchive(appArchive);
if (aModule.getAlternateDescriptor()!=null) {
// the module use alternate deployement descriptor, ignore the
// DDs in the archive.
InputStream is = appArchive.getEntry(aModule.getAlternateDescriptor());
DeploymentDescriptorFile ddFile = newArchivist.getStandardDDFile();
ddFile.setXMLValidation(newArchivist.getXMLValidation());
ddFile.setXMLValidationLevel(newArchivist.getXMLValidationLevel());
if (appArchive.getURI()!=null) {
ddFile.setErrorReportingString(appArchive.getURI().getSchemeSpecificPart());
}
descriptor = (BundleDescriptor) ddFile.read(is);
((BundleDescriptor)descriptor).setApplication(app);
is.close();
// TODO : JD need to be revisited for EAR files with Alternative descriptors, what does
// it mean for sub components.
Map<ExtensionsArchivist, RootDeploymentDescriptor> extensions =
new HashMap<ExtensionsArchivist, RootDeploymentDescriptor>();
if (extensionsArchivists!=null) {
for (ExtensionsArchivist extension : extensionsArchivists) {
if (extension.supportsModuleType(aModule.getModuleType())) {
Object rdd = extension.open(newArchivist, embeddedArchive, descriptor);
if (rdd instanceof RootDeploymentDescriptor) {
extensions.put(extension, (RootDeploymentDescriptor) rdd);
}
}
}
}
newArchivist.postStandardDDsRead(descriptor, embeddedArchive, extensions);
newArchivist.readAnnotations(embeddedArchive, descriptor, extensions);
newArchivist.postAnnotationProcess(descriptor, embeddedArchive);
newArchivist.postOpen(descriptor, embeddedArchive);
// now reads the runtime deployment descriptor...
if (isHandlingRuntimeInfo()) {
is = appArchive.getEntry("sun-" + aModule.getAlternateDescriptor());
if (is!=null) {
DeploymentDescriptorFile confDD =
newArchivist.getConfigurationDDFile();
confDD.setXMLValidation(
newArchivist.getRuntimeXMLValidation());
confDD.setXMLValidationLevel(
newArchivist.getRuntimeXMLValidationLevel());
if (appArchive.getURI()!=null) {
confDD.setErrorReportingString(
appArchive.getURI().getSchemeSpecificPart());
}
confDD.read(descriptor, is);
is.close();
newArchivist.postRuntimeDDsRead((RootDeploymentDescriptor)descriptor, embeddedArchive);
} else {
if (embeddedArchive!=null) {
newArchivist.readRuntimeDeploymentDescriptor(embeddedArchive,descriptor);