Package org.glassfish.deployment.common
Class RootDeploymentDescriptor
- java.lang.Object
-
- java.util.Observable
-
- org.glassfish.deployment.common.DynamicAttributesDescriptor
-
- org.glassfish.deployment.common.Descriptor
-
- org.glassfish.deployment.common.RootDeploymentDescriptor
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BundleDescriptor
,PermissionsDescriptor
,PersistenceUnitsDescriptor
,WebServicesDescriptor
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
Fields Modifier and Type Field Description protected ClassLoader
classLoader
class loader associated to this module to load classes contained in the archive filestatic Logger
deplLogger
protected Map<Class<? extends RootDeploymentDescriptor>,List<RootDeploymentDescriptor>>
extensions
Extensions for this module descriptor, keyed by type, indexed using the instance's indexprotected 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
Constructors Constructor Description RootDeploymentDescriptor()
Construct a new RootDeploymentDescriptorRootDeploymentDescriptor(String name, String description)
Construct a new RootDeploymentDescriptor with a name and description
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T extends RootDeploymentDescriptor>
voidaddExtensionDescriptor(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>
TgetExtensionsDescriptors(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 scopeRootDeploymentDescriptor
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()
abstract boolean
isEmpty()
Return true if this root deployment descriptor does not describe anythingboolean
isExtensionDescriptor()
void
print(StringBuilder toStringBuilder)
print a meaningful string for this objectvoid
setClassLoader(ClassLoader classLoader)
Sets the class loader for this applicationvoid
setDisplayName(String name)
sets the display name for this bundlevoid
setModuleDescriptor(ModuleDescriptor descriptor)
Sets the module descriptor for this bundlevoid
setModuleID(String moduleID)
each module is uniquely identified with a moduleIDvoid
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
-
-
-
-
Field Detail
-
deplLogger
public static final Logger deplLogger
-
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)
-
-
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 classDescriptor
- Parameters:
name
- the display name
-
getDisplayName
public String getDisplayName()
- Overrides:
getDisplayName
in classDescriptor
- 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 classDescriptor
- 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 classDescriptor
- 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(StringBuilder toStringBuilder)
print a meaningful string for this object- Overrides:
print
in classDescriptor
-
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 typeindex
- 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
-
-