DescriptorArchivistpublic class DescriptorArchivist extends Object This class is responsible for writing deployment descriptors
after a deployment action has occured to a abstract archive instance. |
Constructors Summary |
---|
public DescriptorArchivist()Creates a new instance of DescriptorArchivist
|
Methods Summary |
---|
public void | write(com.sun.enterprise.deployment.Application application, com.sun.enterprise.deployment.deploy.shared.AbstractArchive out)writes an application deployment descriptors
if (application.isVirtual()) {
ModuleDescriptor aModule = (ModuleDescriptor) application.getModules().next();
Archivist moduleArchivist = ArchivistFactory.getArchivistForType(aModule.getModuleType());
write(aModule.getDescriptor(), moduleArchivist, out);
} else {
// this is a real application.
// let's start by writing out all submodules deployment descriptors
for (Iterator modules = application.getModules();modules.hasNext();) {
ModuleDescriptor aModule = (ModuleDescriptor) modules.next();
Archivist moduleArchivist = ArchivistFactory.getArchivistForType(aModule.getModuleType());
if (aModule.getAlternateDescriptor()!=null) {
// the application is using alternate deployment descriptors
String runtimeDDPath = "sun-" + aModule.getAlternateDescriptor();
DeploymentDescriptorFile ddFile = moduleArchivist.getConfigurationDDFile();
if (ddFile!=null) {
OutputStream os = out.putNextEntry(runtimeDDPath);
ddFile.write(aModule.getDescriptor(), os);
out.closeEntry();
}
} else {
AbstractArchive moduleArchive = out.getEmbeddedArchive(aModule.getArchiveUri());
write(aModule.getDescriptor(), moduleArchivist, moduleArchive);
}
}
// now let's write the application runtime descriptor
ApplicationArchivist archivist = new ApplicationArchivist();
archivist.setDescriptor(application);
archivist.writeRuntimeDeploymentDescriptors(out);
}
| public void | write(com.sun.enterprise.deployment.BundleDescriptor bundle, com.sun.enterprise.deployment.deploy.shared.AbstractArchive out)writes a bundle descriptor
Archivist archivist = ArchivistFactory.getArchivistForArchive(out);
write(bundle, archivist, out);
| protected void | write(com.sun.enterprise.deployment.BundleDescriptor bundle, com.sun.enterprise.deployment.archivist.Archivist archivist, com.sun.enterprise.deployment.deploy.shared.AbstractArchive out)writes a bundle descriptor
archivist.setDescriptor(bundle);
archivist.writeRuntimeDeploymentDescriptors(out);
// now if this is a web bundle descriptor, we may need to rewrite the standard
// deployment descriptors if we have web services since the servlet implementation
// has been switched
if (bundle.getModuleType().equals(ModuleType.WAR)) {
WebBundleDescriptor webBundle = (WebBundleDescriptor) bundle;
if (webBundle.hasWebServices()) {
archivist.writeStandardDeploymentDescriptors(out);
}
}
|
|