org.glassfish.deployment.common
Class RootDeploymentDescriptor

java.lang.Object
  extended by java.util.Observable
      extended by org.glassfish.deployment.common.DynamicAttributesDescriptor
          extended by org.glassfish.deployment.common.Descriptor
              extended by org.glassfish.deployment.common.RootDeploymentDescriptor
All Implemented Interfaces:
Serializable

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
See Also:
Serialized Form

Field Summary
protected  ClassLoader classLoader
          class loader associated to this module to load classes contained in the archive file
protected  Map<Class<? extends RootDeploymentDescriptor>,List<RootDeploymentDescriptor>> extensions
          Extensions for this module descriptor, keyed by type, indexed using the instance's index
protected  ModuleDescriptor moduleDescriptor
          contains the information for this module (like it's module name)
protected  String moduleID
          each module is uniquely identified with a moduleID
 
Fields inherited from class org.glassfish.deployment.common.Descriptor
DESCRIPTION_CHANGED, DESCRIPTOR_CHANGED, docType, LARGE_ICON_CHANGED, NAME_CHANGED, SMALL_ICON_CHANGED
 
Constructor Summary
RootDeploymentDescriptor()
          Construct a new RootDeploymentDescriptor
RootDeploymentDescriptor(String name, String description)
          Construct a new RootDeploymentDescriptor with a name and description
 
Method Summary
<T extends RootDeploymentDescriptor>
void
addExtensionDescriptor(Class<? extends RootDeploymentDescriptor> type, T instance, String index)
           
abstract  ClassLoader getClassLoader()
           
abstract  String getDefaultSpecVersion()
           
 String getDisplayName()
           
 Collection<RootDeploymentDescriptor> getExtensionsDescriptors()
          This method returns all the extensions deployment descriptors in the scope
<T extends RootDeploymentDescriptor>
T
getExtensionsDescriptors(Class<? extends RootDeploymentDescriptor> type, String index)
          This method returns one extension of the passed type in the scope with the right index
<T extends RootDeploymentDescriptor>
Collection<T>
getExtensionsDescriptors(Class<T> type)
          This method returns all extensions of the passed type in the scope
 RootDeploymentDescriptor getMainDescriptor()
           
 ModuleDescriptor getModuleDescriptor()
           
abstract  String getModuleID()
           
abstract  ArchiveType getModuleType()
           
 String getName()
          as of J2EE1.4, get/setName are deprecated, people should use the set/getDisplayName or the set/getModuleID.
 String getSchemaLocation()
           
 String getSpecVersion()
           
 DescriptorVisitor getTracerVisitor()
           
abstract  boolean isApplication()
           
 boolean isDDWithNoAnnotationAllowed()
           
abstract  boolean isEmpty()
          Return true if this root deployment descriptor does not describe anything
 boolean isExtensionDescriptor()
           
 boolean isFullAttribute()
          Get the full attribute of the deployment descriptor
 boolean isFullFlag()
           
 void print(StringBuffer toStringBuffer)
          print a meaningful string for this object
 void setClassLoader(ClassLoader classLoader)
          Sets the class loader for this application
 void setDisplayName(String name)
          sets the display name for this bundle
 void setFullAttribute(String value)
          Sets the full attribute of the deployment descriptor
 void setFullFlag(boolean flag)
          Sets the full flag of the bundle descriptor.
 void setModuleDescriptor(ModuleDescriptor descriptor)
          Sets the module descriptor for this bundle
 void setModuleID(String moduleID)
          each module is uniquely identified with a moduleID
 void setName(String name)
          as of J2EE1.4, get/setName are deprecated, people should use the set/getDisplayName or the set/getModuleID.
 void setSchemaLocation(String schemaLocation)
           
 void setSpecVersion(String specVersion)
          Sets the specification version of the deployment descriptor
 
Methods inherited from class org.glassfish.deployment.common.Descriptor
addDescriptorExtension, addPrefixMapping, createUniqueFilenameAmongst, createUniqueNameAmongst, createUniqueNameAmongstNamedDescriptors, fillDocType, getDeploymentExtensions, getDescription, getDescriptorExtension, getDescriptorExtensions, getDocType, getLargeIconUri, getLocalizedDescription, getLocalizedDescriptions, getLocalizedDisplayName, getLocalizedDisplayNames, getLocalizedLargeIconUri, getLocalizedLargeIconUris, getLocalizedSmallIconUri, getLocalizedSmallIconUris, getPrefixMapping, getSmallIconUri, isBoundsChecking, setBoundsChecking, setDescription, setLargeIconUri, setLocalizedDescription, setLocalizedDisplayName, setLocalizedLargeIconUri, setLocalizedSmallIconUri, setSmallIconUri, visit
 
Methods inherited from class org.glassfish.deployment.common.DynamicAttributesDescriptor
addExtraAttribute, getExtraAttribute, getExtraAttributes, removeExtraAttribute, toString
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

moduleID

protected String moduleID
each module is uniquely identified with a moduleID


classLoader

protected transient ClassLoader classLoader
class loader associated to this module to load classes contained in the archive file


extensions

protected Map<Class<? extends RootDeploymentDescriptor>,List<RootDeploymentDescriptor>> extensions
Extensions for this module descriptor, keyed by type, indexed using the instance's index


moduleDescriptor

protected ModuleDescriptor moduleDescriptor
contains the information for this module (like it's module name)

Constructor Detail

RootDeploymentDescriptor

public RootDeploymentDescriptor()
Construct a new RootDeploymentDescriptor


RootDeploymentDescriptor

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

Method Detail

setModuleID

public void setModuleID(String moduleID)
each module is uniquely identified with a moduleID

Parameters:
moduleID - for this module

getModuleID

public abstract String getModuleID()
Returns:
the module ID for this module descriptor

getDefaultSpecVersion

public abstract String getDefaultSpecVersion()
Returns:
the default version of the deployment descriptor loaded by this descriptor

isEmpty

public abstract boolean isEmpty()
Return true if this root deployment descriptor does not describe anything

Returns:
true if this root descriptor is empty

getSpecVersion

public String getSpecVersion()
Returns:
the specification version of the deployment descriptor loaded by this descriptor

setSpecVersion

public void setSpecVersion(String specVersion)
Sets the specification version of the deployment descriptor

Parameters:
specVersion - version number

getModuleType

public abstract ArchiveType getModuleType()
Returns:
the module type for this bundle descriptor

getTracerVisitor

public DescriptorVisitor getTracerVisitor()
Returns:
the tracer visitor for this descriptor

setClassLoader

public void setClassLoader(ClassLoader classLoader)
Sets the class loader for this application


getClassLoader

public abstract ClassLoader getClassLoader()
Returns:
the class loader associated with this module

setDisplayName

public void setDisplayName(String name)
sets the display name for this bundle

Overrides:
setDisplayName in class Descriptor
Parameters:
name - the display name

getDisplayName

public String getDisplayName()
Overrides:
getDisplayName in class Descriptor
Returns:
the display name

setName

public void setName(String name)
as of J2EE1.4, get/setName are deprecated, people should use the set/getDisplayName or the set/getModuleID.

Overrides:
setName in class Descriptor
Parameters:
name - the new name of the descriptor.

getName

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

Overrides:
getName in class Descriptor
Returns:
the name of this descriptor

setSchemaLocation

public void setSchemaLocation(String schemaLocation)

getSchemaLocation

public String getSchemaLocation()

getModuleDescriptor

public ModuleDescriptor getModuleDescriptor()
Returns:
the module descriptor for this bundle

setModuleDescriptor

public void setModuleDescriptor(ModuleDescriptor descriptor)
Sets the module descriptor for this bundle

Parameters:
descriptor - for the module

isApplication

public abstract boolean isApplication()
Returns:
true if this module is an application object

print

public void print(StringBuffer toStringBuffer)
print a meaningful string for this object

Overrides:
print in class Descriptor

getExtensionsDescriptors

public Collection<RootDeploymentDescriptor> getExtensionsDescriptors()
This method returns all the extensions deployment descriptors in the scope

Returns:
an unmodifiable collection of extensions or empty collection if none.

getExtensionsDescriptors

public <T extends RootDeploymentDescriptor> Collection<T> getExtensionsDescriptors(Class<T> type)
This method returns all extensions of the passed type in the scope

Parameters:
type - requested extension type
Returns:
an unmodifiable collection of extensions or empty collection if none.

getExtensionsDescriptors

public <T extends RootDeploymentDescriptor> T getExtensionsDescriptors(Class<? extends RootDeploymentDescriptor> type,
                                                                       String index)
This method returns one extension of the passed type in the scope with the right index

Parameters:
type - requested extension type
index - is the instance index
Returns:
an unmodifiable collection of extensions or empty collection if none.

addExtensionDescriptor

public <T extends RootDeploymentDescriptor> void addExtensionDescriptor(Class<? extends RootDeploymentDescriptor> type,
                                                                        T instance,
                                                                        String index)

isExtensionDescriptor

public boolean isExtensionDescriptor()
Returns:
whether this descriptor is an extension descriptor of a main descriptor, e.g. the EjbBundleDescriptor for ejb in war case should return true.

getMainDescriptor

public RootDeploymentDescriptor getMainDescriptor()
Returns:
the main descriptor associated with it if it's an extension descriptor, otherwise return itself

setFullFlag

public void setFullFlag(boolean flag)
Sets the full flag of the bundle descriptor. Once set, the annotations of the classes contained in the archive described by this bundle descriptor will be ignored.

Parameters:
flag - a boolean to set or unset the flag

setFullAttribute

public void setFullAttribute(String value)
Sets the full attribute of the deployment descriptor

Parameters:
value - the full attribute

isFullAttribute

public boolean isFullAttribute()
Get the full attribute of the deployment descriptor

Returns:
the full attribute

isFullFlag

public boolean isFullFlag()

isDDWithNoAnnotationAllowed

public boolean isDDWithNoAnnotationAllowed()


Copyright © 2012. All Rights Reserved.