Methods Summary |
---|
protected com.sun.enterprise.deployment.util.ModuleDescriptor | addToArchive(ApplicationArchivist appArch, java.lang.String externalDD)Add this archive to an application archivist
ModuleDescriptor module = super.addToArchive(appArch, externalDD);
if (module!=null) {
ApplicationClientDescriptor acd = (ApplicationClientDescriptor) module.getDescriptor();
AbstractArchive jarFile = abstractArchiveFactory.openArchive(getArchiveUri());
Manifest jarManifest = jarFile.getManifest();
if (jarManifest!=null) {
String mainClassName = getMainClassName(jarManifest);
if (mainClassName!=null) {
acd.setMainClassName(mainClassName);
}
}
jarFile.close();
}
return module;
|
protected java.lang.String | getArchiveExtension()
return APPCLIENT_EXTENSION;
|
public com.sun.enterprise.deployment.io.DeploymentDescriptorFile | getConfigurationDDFile()
return new AppClientRuntimeDDFile();
|
public com.sun.enterprise.deployment.Descriptor | getDefaultBundleDescriptor()
ApplicationClientDescriptor appClientDesc =
new ApplicationClientDescriptor();
return appClientDesc;
|
public com.sun.enterprise.deployment.Descriptor | getDescriptor()
return descriptor;
|
public java.lang.String | getMainClassName(java.util.jar.Manifest m)
if (m!=null) {
return m.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS);
}
return null;
|
public javax.enterprise.deploy.shared.ModuleType | getModuleType()
return ModuleType.CAR;
|
public com.sun.enterprise.deployment.io.DeploymentDescriptorFile | getStandardDDFile()
return standardDD;
|
protected boolean | postHandles(com.sun.enterprise.deployment.deploy.shared.AbstractArchive abstractArchive)
//check the main-class attribute
if (getMainClassName(abstractArchive.getManifest()) != null) {
return true;
}
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);
ApplicationClientDescriptor appClient = (ApplicationClientDescriptor) descriptor;
ModuleContentValidator mdv = new ModuleContentValidator(archive);
appClient.visit(mdv);
|
protected void | postStandardDDsRead(com.sun.enterprise.deployment.RootDeploymentDescriptor descriptor, com.sun.enterprise.deployment.deploy.shared.AbstractArchive archive)perform any action after all standard DDs is read
super.postStandardDDsRead(descriptor, archive);
// look for MAIN_CLASS
ApplicationClientDescriptor appClient = (ApplicationClientDescriptor)descriptor;
Manifest m = archive.getManifest();
appClient.setMainClassName(getMainClassName(m));
|
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, "AppClientArchivist",
"readPersistenceDeploymentDescriptors", "archive = {0}",
archive.getURI());
}
// note we pass "" as the PURootPath because META-INF/persistence.xml
// can only be present on the top level in an client-jar, so the root of
// persistence unit is always same as the root of an client-jar file.
// hence relative distance between them is empty.
readPersistenceDeploymentDescriptor(archive, "", descriptor);
|
public void | setDescriptor(com.sun.enterprise.deployment.Descriptor descriptor)Set the DOL descriptor for this Archivist, used by super classes
if (descriptor instanceof ApplicationClientDescriptor) {
this.descriptor = (ApplicationClientDescriptor) descriptor;
} else {
if (descriptor instanceof Application) {
// this is acceptable if the application actually represents
// a standalone module
java.util.Set appClientBundles = ((Application) descriptor).getApplicationClientDescriptors();
if (appClientBundles.size()>0) {
this.descriptor = (ApplicationClientDescriptor) appClientBundles.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((AppClientVisitor) new ApplicationValidator());
|
protected void | writeContents(com.sun.enterprise.deployment.deploy.shared.AbstractArchive in, com.sun.enterprise.deployment.deploy.shared.AbstractArchive out, java.util.Vector entriesToSkip)writes the content of an archive to a JarFile
// prepare the manifest file to add the main class entry
if (manifest==null) {
manifest = new Manifest();
}
manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, MANIFEST_VERSION_VALUE);
manifest.getMainAttributes().put(Attributes.Name.MAIN_CLASS,
((ApplicationClientDescriptor) getDescriptor()).getMainClassName());
super.writeContents(in, out, entriesToSkip);
|