FileDocCategorySizeDatePackage
ModuleDescriptor.javaAPI DocGlassfish v2 API7955Fri May 04 22:31:58 BST 2007com.sun.enterprise.deployment.util

ModuleDescriptor

public class ModuleDescriptor extends com.sun.enterprise.deployment.Descriptor
This class describes a module information for an applicaiton module
author
Jerome Dochez
version

Fields Summary
private javax.enterprise.deploy.shared.ModuleType
type
type of the module, currently EJB, WEB...
private String
path
path for the module bundle
private String
altDD
alternate descriptor (if any) path
private String
contextRoot
context-root if dealing with a web module
private com.sun.enterprise.deployment.BundleDescriptor
descriptor
loaded deployment descriptor for this module
private transient Manifest
manifest
manifest information for this module
private boolean
standalone
is it a standalone module, or part of a J2EE Application
Constructors Summary
public ModuleDescriptor()
Creates new ModuleDescriptor

    
        
      
    
Methods Summary
public voidaddWebDeploymentExtension(com.sun.enterprise.deployment.DeploymentExtensionDescriptor de)
Add a new deployment-extension for this descriptor

param
deployment-extension descriptor to add

        Vector extensions = (Vector) getExtraAttribute("web-deployment-extension");
        if (extensions==null) {
            extensions = new Vector();
            addExtraAttribute("web-deployment-extension", extensions);
        }
        extensions.add(de);
    
public java.lang.StringgetAlternateDescriptor()

return
the alternate deployment descriptor path or null if this module does not use alternate deployment descriptors

        return altDD;
    
public java.lang.StringgetArchiveUri()

return
the archive uri for this module

        return path;
    
public java.lang.StringgetContextRoot()

return
the context root for a web module

        return contextRoot;
    
public com.sun.enterprise.deployment.BundleDescriptorgetDescriptor()

return
the @see BundleDescriptor module descriptor

        return descriptor;
    
public java.util.jar.ManifestgetManifest()

return
the @see Manifest manifest information for this module

        return manifest;
    
public javax.enterprise.deploy.shared.ModuleTypegetModuleType()

return
the module type for this module

        if (descriptor!=null) {
            return descriptor.getModuleType();
        } 
        return type;
    
public java.util.IteratorgetWebDeploymentExtensions()

return
an iterator on the deployment-extension

        Vector extensions = (Vector) getExtraAttribute("web-deployment-extension");
        if (extensions!=null) {
            return extensions.iterator();
        } 
        return null;
    
public booleanisStandalone()

return
true if this module is a standalone module

        return standalone;
    
public voidprint(java.lang.StringBuffer toStringBuffer)

return
a meaningful string about myself

        toStringBuffer.append(type + " ModuleDescriptor: [  " + path + " ] , altDD = " + altDD);
        if (contextRoot!=null) {
            toStringBuffer.append(" , ContextRoot = " + contextRoot);
        }
    
private voidreadObject(java.io.ObjectInputStream in)

                
         // just read this intance fields...
         path = (String) in.readObject();
         altDD = (String) in.readObject();
         contextRoot = (String) in.readObject();
         descriptor = (BundleDescriptor) in.readObject();
         standalone = in.readBoolean();           
    
public voidsetAlternateDescriptor(java.lang.String altDD)
Sets the path to the alternate deployment descriptors in the application archive

param
altDD the uri for the deployment descriptors

        this.altDD = altDD;
    
public voidsetArchiveUri(java.lang.String path)
Sets the archive uri as defined in the application xml or the full archive path for standalone modules

path
the module path

        this.path = path;
    
public voidsetContextRoot(java.lang.String contextRoot)
Sets the context root for Web module

param
contextRoot the contextRoot

        this.contextRoot = contextRoot;
    
public voidsetDescriptor(com.sun.enterprise.deployment.BundleDescriptor descriptor)
Sets the @see BundleDescriptor descriptor for this module

param
descriptor the module descriptor

        descriptor.setModuleDescriptor(this);
        this.descriptor = descriptor;
    
public voidsetManifest(java.util.jar.Manifest m)
Sets the @see Manifest manifest information for this module

        manifest = m;
    
public voidsetModuleType(javax.enterprise.deploy.shared.ModuleType type)

        this.type = type;
    
public voidsetStandalone(boolean standalone)
Sets the standalone flag

        this.standalone = standalone;
    
private voidwriteObject(java.io.ObjectOutputStream out)
Implementation of the serializable interface since ModuleType is not serializable

                 
         // just write this intance fields...
         out.writeObject(path);
         out.writeObject(altDD);
         out.writeObject(contextRoot);
         out.writeObject(descriptor);
         out.writeBoolean(standalone);