Methods Summary |
---|
protected java.lang.String | getArchiveExtension()
return WEB_EXTENSION;
|
public com.sun.enterprise.deployment.io.DeploymentDescriptorFile | getConfigurationDDFile()
return new WebRuntimeDDFile();
|
public com.sun.enterprise.deployment.Descriptor | getDefaultBundleDescriptor()
WebBundleDescriptor webBundleDesc =
DOLLoadingContextFactory.getDefaultWebBundleDescriptor();
return webBundleDesc;
|
public com.sun.enterprise.deployment.Descriptor | getDescriptor()
return descriptor;
|
public java.util.Vector | getLibraries(com.sun.enterprise.deployment.deploy.shared.AbstractArchive archive)
Enumeration<String> entries = archive.entries();
if (entries==null)
return null;
Vector libs = new Vector();
while (entries.hasMoreElements()) {
String entryName = entries.nextElement();
if (!entryName.startsWith("WEB-INF/lib")) {
continue; // not in WEB-INF...
}
if (entryName.endsWith(".jar")) {
libs.add(entryName);
}
}
return libs;
|
public javax.enterprise.deploy.shared.ModuleType | getModuleType()
return ModuleType.WAR;
|
public com.sun.enterprise.deployment.io.DeploymentDescriptorFile | getStandardDDFile()
return standardDD;
|
public java.lang.String | getWebServicesDeploymentDescriptorPath()
return DescriptorConstants.WEB_WEBSERVICES_JAR_ENTRY;
|
protected boolean | postHandles(com.sun.enterprise.deployment.deploy.shared.AbstractArchive abstractArchive)In the case of web archive, the super handles() method should be able
to make a unique identification. If not, then the archive is definitely
not a war.
return false;
|
protected void | postOpen(com.sun.enterprise.deployment.RootDeploymentDescriptor descriptor, com.sun.enterprise.deployment.deploy.shared.AbstractArchive archive)perform any post deployment descriptor reading action
super.postOpen(descriptor, archive);
WebBundleDescriptor webBundle = (WebBundleDescriptor) descriptor;
ModuleContentValidator mdv = new ModuleContentValidator(archive);
webBundle.visit(mdv);
|
public void | readPersistenceDeploymentDescriptors(com.sun.enterprise.deployment.deploy.shared.AbstractArchive archive, com.sun.enterprise.deployment.Descriptor descriptor)
if(logger.isLoggable(Level.FINE)) {
logger.logp(Level.FINE, "WebArchivist",
"readPersistenceDeploymentDescriptors", "archive = {0}",
archive.getURI());
}
Map<String, Archive> subArchives = new HashMap<String, Archive>();
Enumeration entries = archive.entries();
final String CLASSES_DIR = "WEB-INF/classes/";
final String LIB_DIR = "WEB-INF/lib/";
final String JAR_EXT = ".jar";
try {
final String pathOfPersistenceXMLInsideClassesDir =
CLASSES_DIR+DescriptorConstants.PERSISTENCE_DD_ENTRY;
while(entries.hasMoreElements()){
final String nextEntry = String.class.cast(entries.nextElement());
if(pathOfPersistenceXMLInsideClassesDir.equals(nextEntry)) {
subArchives.put(CLASSES_DIR, archive.getSubArchive(CLASSES_DIR));
} else if (nextEntry.startsWith(LIB_DIR) && nextEntry.endsWith(JAR_EXT)) {
String jarFile = nextEntry.substring(LIB_DIR.length(), nextEntry.length()-JAR_EXT.length());
if(jarFile.indexOf('/") == -1) { // to avoid WEB-INF/lib/foo/bar.jar
// this jarFile is directly inside WEB-INF/lib directory
subArchives.put(nextEntry, archive.getSubArchive(nextEntry));
} else {
if(logger.isLoggable(Level.FINE)) {
logger.logp(Level.FINE, "WebArchivist",
"readPersistenceDeploymentDescriptors",
"skipping {0} as it exists inside a directory in {1}.",
new Object[]{nextEntry, LIB_DIR});
}
continue;
}
}
}
for(Map.Entry<String, Archive> pathToArchiveEntry : subArchives.entrySet()) {
readPersistenceDeploymentDescriptor(pathToArchiveEntry.getValue(), pathToArchiveEntry.getKey(), descriptor);
}
} finally {
for(Archive subArchive : subArchives.values()) {
subArchive.close();
}
}
|
public void | setDescriptor(com.sun.enterprise.deployment.Descriptor descriptor)Archivist read XML deployment descriptors and keep the
parsed result in the DOL descriptor instances. Sets the descriptor
for a particular Archivst type
if (descriptor instanceof WebBundleDescriptor) {
this.descriptor = (WebBundleDescriptor) descriptor;
} else {
if (descriptor instanceof Application) {
// this is acceptable if the application actually represents
// a standalone module
java.util.Set webBundles = ((Application) descriptor).getWebBundleDescriptors();
if (webBundles.size()>0) {
this.descriptor = (WebBundleDescriptor) webBundles.iterator().next();
if (this.descriptor.getModuleDescriptor().isStandalone())
return;
else
this.descriptor=null;
}
}
DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.deployment.backend.descriptorFailure", new Object[] {this});
throw new RuntimeException("Error setting descriptor " + descriptor + " in " + this);
}
|
public void | validate(java.lang.ClassLoader aClassLoader)validates the DOL Objects associated with this archivist, usually
it requires that a class loader being set on this archivist or passed
as a parameter
ClassLoader cl = aClassLoader;
if (cl==null) {
cl = classLoader;
}
if (cl==null) {
return;
}
descriptor.setClassLoader(cl);
descriptor.visit((WebBundleVisitor) new ApplicationValidator());
|