* @throws ConfigException if unable to load the deployment descriptor
*/
public Application getDescriptor(String modId, ClassLoader cl, String modDir,
boolean validateXml) throws ConfigException {
Application application = getRegisteredDescriptor(modId);
if (application!=null) {
application.setClassLoader(cl);
return application;
}
try {
AppClientArchivist appClientArchivist = new AppClientArchivist();
appClientArchivist.setXMLValidation(validateXml);
appClientArchivist.setClassLoader(cl);
FileArchive archive = openDDArchive(modId, modDir);
// Try to load the app from the serialized descriptor file.
SerializedDescriptorHelper.Loader sdLoader =
SerializedDescriptorHelper.load(modId, this);
Application deserializedApplication = sdLoader.getApplication();
if (deserializedApplication != null) {
application = deserializedApplication;
} else {
application = ApplicationArchivist.openArchive(modId, appClientArchivist, archive, true);
}