// processing
ClassLoader origContextClassLoader =
Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(ejbClassLoader);
Application application = request.getDescriptor();
if (application!=null && ModuleType.EAR.equals(archivist.getModuleType())) {
archivist.readPersistenceDeploymentDescriptors(in, application);
// Now process standard DDs, do this before runtime DDs
archivist.setHandleRuntimeInfo(false);
boolean modulesReadSuccess = ((ApplicationArchivist) archivist).readModulesDescriptors(application, in);
if (modulesReadSuccess ) {
// now process runtime DDs
archivist.setHandleRuntimeInfo(true);
archivist.readRuntimeDeploymentDescriptor(in, application);
} else {
// it failed reading sub modules, I null our application which will trigger
// deployment failure handling
application=null;
}
} else {
application = ApplicationArchivist.openArchive(archivist, in, true);
}
if (application==null) {
throw new IASDeploymentException(localStrings.getString(
"enterprise.deployment.backend.error_loading_dds",
new Object[] { request.getName(), " " }));
}
application.setRegistrationName(request.getName());
application.setClassLoader(ejbClassLoader);
archivist.setDescriptor(application);
// let's check for optional dependencies
if (!archivist.performOptionalPkgDependenciesCheck(in)) {
throw new IASDeploymentException(localStrings.getString("enterprise.deployment.backend.archive_opt_dep_not_satisfied", new Object[] {in.getArchiveUri()}));
}
archivist.validate(ejbClassLoader);
if (!application.getWebServiceDescriptors().isEmpty()) {
ModuleContentLinker visitor = new ModuleContentLinker(in);
application.visit((com.sun.enterprise.deployment.util.ApplicationVisitor) visitor);
}
request.setDescriptor(application);
// restore the original context class loader
Thread.currentThread().setContextClassLoader(