// reads std & iAS application xml
try {
// Set classloader before opening archive to enable
// validation.
AppClientArchivist arch = new AppClientArchivist();
arch.setAnnotationProcessingRequested(true);
arch.setClassLoader(jcl);
// for class case, get default bundle
if (className!=null) {
appDesc = (ApplicationClientDescriptor) arch.getDefaultBundleDescriptor();
} else {
// for client jar case, do not process annotations.
// use AppClientArchivist.open(String) instead of
// AppClientArchivist.open(AbstractArchive) since the
// open(String) method calls validate.
appDesc = (ApplicationClientDescriptor) arch.open(appClientFile.getAbsolutePath());
}
if (className!=null) {
// post masssaging
AbstractArchive archive;
if (appClientFile.isDirectory()) {
archive = new FileArchive();
((FileArchive) archive).open(appClientFile.getAbsolutePath());
} else {
archive = new InputJarArchive();
((InputJarArchive) archive).open(appClientFile.getAbsolutePath());
}
if (appDesc.getMainClassName()==null || appDesc.getMainClassName().length()==0) {
appDesc.setMainClassName(className);
arch.processAnnotations(appDesc, archive);
// let's remove our appArgs first element since it was the app client class name
//...but only if this is not a Java Web Start launch.
if (mainClass==null && ! isJWS) {
appArgs.removeElementAt(0);