Methods Summary |
---|
public com.sun.enterprise.deployment.Application | getApplication()
return app;
|
public java.lang.String[] | getClientModules()
String[] ss = new String[clientModules.size()];
return (String[])clientModules.toArray(ss);
|
public java.lang.String[] | getContextRoots()
String[] ss = new String[contextRoots.size()];
return (String[])contextRoots.toArray(ss);
|
public java.lang.String[] | getEjbModules()
String[] ss = new String[ejbModules.size()];
return (String[])ejbModules.toArray(ss);
|
public java.io.File | getFile()
return file;
|
public java.lang.String[] | getRarModules()
String[] ss = new String[rarModules.size()];
return (String[])rarModules.toArray(ss);
|
public java.lang.String[] | getWarModules()
String[] ss = new String[warModules.size()];
return (String[])warModules.toArray(ss);
|
private void | parse(boolean validateXML)
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
ApplicationDeploymentDescriptorFile addf = new ApplicationDeploymentDescriptorFile();
addf.setXMLValidation(validateXML);
if (validateXML) {
addf.setXMLValidationLevel(addf.PARSING_VALIDATION);
}
app = (Application) addf.read(fis);
// read runtime deployment descriptor file if it exists
if (file2 != null) {
FileInputStream fis2 = new FileInputStream(file2);
ApplicationRuntimeDDFile arddf =
new ApplicationRuntimeDDFile();
arddf.setXMLValidation(validateXML);
if (validateXML) {
arddf.setXMLValidationLevel(arddf.PARSING_VALIDATION);
}
app = (Application)arddf.read(app, fis2);
if (fis2 != null) {
fis2.close();
}
}
// WBN 4-19-2002 -- If we are using this class ONLY for getting
// context-roots -- please note that node.getApplication(null) has
// already done all the time-consuming work. The getXXXX methods
// simply return a reference. So performance isn't an issue.
for (Iterator modules = app.getModules(); modules.hasNext();) {
ModuleDescriptor md = (ModuleDescriptor) modules.next();
if (md.getModuleType().equals(ModuleType.EJB)) {
ejbModules.add(md.getArchiveUri());
} else
if (md.getModuleType().equals(ModuleType.WAR)) {
warModules.add(md.getArchiveUri());
} else
if (md.getModuleType().equals(ModuleType.CAR)) {
clientModules.add(md.getArchiveUri());
} else
if (md.getModuleType().equals(ModuleType.RAR)) {
rarModules.add(md.getArchiveUri());
}
}
setContextRoots(app);
} finally {
if (fis != null) {
fis.close();
}
}
|
private void | setContextRoots(com.sun.enterprise.deployment.Application app)
assert app != null;
assert warModules != null;
assert contextRoots == null; // error to call this method more than once
contextRoots = new HashSet();
for(Iterator it = warModules.iterator(); it.hasNext(); ) {
ModuleDescriptor md = app.getModuleDescriptorByUri((String) it.next());
String cr = md.getContextRoot();
if(contextRoots.add(cr) == false) {
// this means that there is more than one web-module
// in the Application with the same context-root
String msg = localStrings.getString(
"enterprise.deployment.backend.duplicate_context_root",
cr );
throw new IASDeploymentException( msg );
}
}
|
private java.lang.String | trim(java.lang.String s)
// change <ejb>xxx</ejb> to xxx
int index = s.indexOf(">");
String ret = s.substring(index + 1);
ret = ret.substring(0, ret.indexOf("<"));
return ret;
|