FileDocCategorySizeDatePackage
RootDeploymentDescriptor.javaAPI DocGlassfish v2 API8827Fri May 04 22:31:22 BST 2007com.sun.enterprise.deployment

RootDeploymentDescriptor

public abstract class RootDeploymentDescriptor extends Descriptor
This descriptor contains all common information amongst root element of the J2EE Deployment Descriptors (application, ejb-jar, web-app, connector...).
author
Jerome Dochez

Fields Summary
protected String
moduleID
each module is uniquely identified with a moduleID
private String
specVersion
version of the specification loaded by this descriptor
protected transient ClassLoader
classLoader
class loader associated to this module to load classes contained in the archive file
protected Map
persistenceUnitsDescriptors
key is the URI representing PURoot.
Constructors Summary
public RootDeploymentDescriptor()
Construct a new RootDeploymentDescriptor


              
      
        super();
    
public RootDeploymentDescriptor(String name, String description)
Construct a new RootDeploymentDescriptor with a name and description

        super(name, description);
    
Methods Summary
public voidaddPersistenceUnitsDescriptor(java.lang.String puRoot, PersistenceUnitsDescriptor persistenceUnitsDescriptor)
Add deplyoment information about all the persistence units defined in a persistence.xml to this RootDeploymentDescriptor. All the persistence units defined inside the same persistence.xml will be added with same PURoot. This method also sets the parent reference in PersistenceUnitsDescriptor.

param
puRoot root of the persistence unit (its a relative path)
param
persistenceUnitsDescriptor is the descriptor object representing the persistence unit.

        // We don't expect the parent to be already set
        // because that indicates transfer of ownership.
        assert(persistenceUnitsDescriptor.getParent() == null);
        persistenceUnitsDescriptor.setParent(this);
        persistenceUnitsDescriptor.setPuRoot(puRoot);
        persistenceUnitsDescriptors.put(puRoot, persistenceUnitsDescriptor);
    
public abstract java.lang.ClassLoadergetClassLoader()

return
the class loader associated with this module

public abstract java.lang.StringgetDefaultSpecVersion()

return
the default version of the deployment descriptor loaded by this descriptor

public java.lang.StringgetDisplayName()

return
the display name

        return super.getName();
    
public abstract java.lang.StringgetModuleID()

return
the module ID for this module descriptor

public abstract javax.enterprise.deploy.shared.ModuleTypegetModuleType()

return
the module type for this bundle descriptor

public java.lang.StringgetName()
as of J2EE1.4, get/setName are deprecated, people should use the set/getDisplayName or the set/getModuleID. note : backward compatibility

        if (getModuleID()!=null) {
            return getModuleID();
        } else {
            return getDisplayName();
        }
    
public PersistenceUnitsDescriptorgetPersistenceUnitsDescriptor(java.lang.String puRoot)
This method returns PersistenceUnitDescriptor object with matching PURoot in the scope of this RootDeploymentDescriptor.

param
puRoot used for lookup
return
return the PersisteneUnitsDescriptor for the given PURoot. It returns null if not found.

        return persistenceUnitsDescriptors.get(puRoot);
    
public java.util.CollectiongetPersistenceUnitsDescriptors()
This method returns PersistenceUnitDescriptor objects in the scope of this RootDeploymentDescriptor.

return
it returns an unmodifiable collection. returns an empty collection if there is no PersistenceUnitDescriptor.

        return Collections.unmodifiableCollection(persistenceUnitsDescriptors.values());
    
public java.lang.StringgetSchemaLocation()

        return (String) getExtraAttribute("schema-location");
    
public java.lang.StringgetSpecVersion()

return
the specification version of the deployment descriptor loaded by this descriptor

        if (specVersion == null) {
            specVersion = getDefaultSpecVersion();
        } 
        try {
            Double.parseDouble(specVersion); 
        } catch (NumberFormatException nfe) {
            DOLUtils.getDefaultLogger().log(Level.WARNING, "invalidSpecVersion",
                new Object[] {specVersion, getDefaultSpecVersion()});
            specVersion = getDefaultSpecVersion();
        }

        return specVersion;
    
public abstract booleanisApplication()

return
true if this module is an application object

public voidprint(java.lang.StringBuffer toStringBuffer)
print a meaningful string for this object

        super.print(toStringBuffer);
        toStringBuffer.append("\n Module Type = ").append(getModuleType());
        toStringBuffer.append("\n Module spec version = ").append(getSpecVersion());
        if (moduleID!=null) 
            toStringBuffer.append("\n Module ID = ").append(moduleID);
        if (getSchemaLocation()!=null)
            toStringBuffer.append("\n Client SchemaLocation = ").append(getSchemaLocation());
    
public voidsetClassLoader(java.lang.ClassLoader classLoader)
Sets the class loader for this application

        this.classLoader = classLoader;
    
public voidsetDisplayName(java.lang.String name)
sets the display name for this bundle

        super.setName(name);
    
public voidsetModuleID(java.lang.String moduleID)
each module is uniquely identified with a moduleID

param
moduleID for this module

        this.moduleID = moduleID;
    
public voidsetName(java.lang.String name)
as of J2EE1.4, get/setName are deprecated, people should use the set/getDisplayName or the set/getModuleID.

        setModuleID(name);
    
public voidsetSchemaLocation(java.lang.String schemaLocation)

        addExtraAttribute("schema-location", schemaLocation);
    
public voidsetSpecVersion(java.lang.String specVersion)
Sets the specification version of the deployment descriptor

param
specVersion version number

        this.specVersion = specVersion;