Class WebComponentDescriptorImpl
- java.lang.Object
-
- java.util.Observable
-
- org.glassfish.deployment.common.DynamicAttributesDescriptor
-
- org.glassfish.deployment.common.Descriptor
-
- com.sun.enterprise.deployment.WebComponentDescriptor
-
- org.glassfish.web.deployment.descriptor.WebComponentDescriptorImpl
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
WebComponentDescriptorStub
public class WebComponentDescriptorImpl extends WebComponentDescriptor
Common data and behavior of the deployment information about a JSP or JavaServlet in J2EE.- Author:
- Jerome Dochez
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringBASIC_AUTHENTICATIONConstant for Basic authentication.static StringDELETEConstant for the http DELETE method.static StringFORM_AUTHENTICATIONConstant for Form authentication.static StringGETConstant for the htpp GET method.static StringPOSTConstant for the http POST method.static StringPUTConstant for the http PUT method.static StringSSL_AUTHENTICATIONConstant for Secure authentication.-
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 WebComponentDescriptorImpl()The default constructor.WebComponentDescriptorImpl(WebComponentDescriptor other)The copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(WebComponentDescriptor other)voidadd(WebComponentDescriptor other, boolean combineUrlPatterns, boolean combineConflict)this method will combine the information from this "other" // WebComponentDescriptor with current WebComponentDescriptor // // when there are conflicts between the contents of the two, // the value from current WebComponentDescriptor will override // the value in "other" // // Note: in the Set API, we only add value when such value // is not existed in the Set already // // If combineUrlPatterns is false, then the first one take priority, // otherwise take the second one.voidaddInitializationParameter(InitializationParameter initializationParameter)Adds a servlet initialization parameter to this component.voidaddSecurityRoleReference(SecurityRoleReference securityRoleReference)Adds a security role reference to this web component.voidaddUrlPattern(String urlPattern)Adds an alias to this web component.booleanequals(Object other)ApplicationgetApplication()StringgetCanonicalName()The canonical name for the web component.Set<String>getConflictedInitParameterNames()InitializationParametergetInitializationParameterByName(String name)Enumeration<InitializationParameter>getInitializationParameters()Set<InitializationParameter>getInitializationParameterSet()IntegergetLoadOnStartUp()MultipartConfiggetMultipartConfig()RunAsIdentityDescriptorgetRunAsIdentity()Gets the run-as of the referee EJB.SecurityRoleReferencegetSecurityRoleReferenceByName(String roleReferenceName)Enumeration<SecurityRoleReference>getSecurityRoleReferences()Set<SecurityRoleReference>getSecurityRoleReferenceSet()Enumeration<String>getUrlPatterns()Set<String>getUrlPatternsSet()Method[]getUserDefinedHttpMethods()This method return an array of user defined http doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace methods.booleangetUsesCallerIdentity()WebBundleDescriptorgetWebBundleDescriptor()StringgetWebComponentImplementation()inthashCode()BooleanisAsyncSupported()booleanisConflict()booleanisConflict(WebComponentDescriptor other, boolean allowNullImplNameOverride)booleanisEnabled()booleanisServlet()voidprint(StringBuilder toStringBuilder)A formatted string representing my state.voidremoveInitializationParameter(InitializationParameter initializationParameter)Removes the given servlet initialization parameter from this component.voidremoveSecurityRoleReference(SecurityRoleReference securityRoleReference)Removes the given security role reference from this web component.voidremoveUrlPattern(String urlPattern)Removes a URL pattern from this web component.voidsetAsyncSupported(Boolean asyncSupported)voidsetCanonicalName(String canonicalName)Sets the canonical name of this web component.voidsetConflict(boolean conflict)voidsetEnabled(boolean enabled)voidsetLoadOnStartUp(Integer loadOnStartUp)Sets the order on which this component will be loaded by the web server.voidsetLoadOnStartUp(String loadOnStartUp)Sets the order on which this component will be loaded by the web server.voidsetMultipartConfig(MultipartConfig multipartConfig)voidsetMultipartConfig(MultipartConfigDescriptor multipartConfigDesc)DeploymentDescriptorNode.addNodeDescriptor(node) need this.voidsetRunAsIdentity(RunAsIdentityDescriptor runAs)Sets the run-as of the referee EJB.voidsetServlet(boolean isServlet)voidsetUsesCallerIdentity(boolean isCallerID)voidsetWebBundleDescriptor(WebBundleDescriptor webBundleDescriptor)voidsetWebComponentImplementation(String implFile)sets the implementation file for this web component, the implementation file is either a servlet class name of a jsp file name.-
Methods inherited from class org.glassfish.deployment.common.Descriptor
addDescriptorExtension, addPrefixMapping, createUniqueFilenameAmongst, createUniqueNameAmongst, createUniqueNameAmongstNamedDescriptors, fillDocType, getDeploymentExtensions, getDescription, getDescriptorExtension, getDescriptorExtensions, getDisplayName, getDocType, getLargeIconUri, getLocalizedDescription, getLocalizedDescriptions, getLocalizedDisplayName, getLocalizedDisplayNames, getLocalizedLargeIconUri, getLocalizedLargeIconUris, getLocalizedSmallIconUri, getLocalizedSmallIconUris, getName, getPrefixMapping, getSmallIconUri, isBoundsChecking, setBoundsChecking, setDescription, setDisplayName, setLargeIconUri, setLocalizedDescription, setLocalizedDisplayName, setLocalizedLargeIconUri, setLocalizedSmallIconUri, setName, 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
-
BASIC_AUTHENTICATION
public static final String BASIC_AUTHENTICATION
Constant for Basic authentication.- See Also:
- Constant Field Values
-
FORM_AUTHENTICATION
public static final String FORM_AUTHENTICATION
Constant for Form authentication.- See Also:
- Constant Field Values
-
SSL_AUTHENTICATION
public static final String SSL_AUTHENTICATION
Constant for Secure authentication.- See Also:
- Constant Field Values
-
GET
public static final String GET
Constant for the htpp GET method.- See Also:
- Constant Field Values
-
PUT
public static final String PUT
Constant for the http PUT method.- See Also:
- Constant Field Values
-
POST
public static final String POST
Constant for the http POST method.- See Also:
- Constant Field Values
-
DELETE
public static final String DELETE
Constant for the http DELETE method.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WebComponentDescriptorImpl
public WebComponentDescriptorImpl()
The default constructor.
-
WebComponentDescriptorImpl
public WebComponentDescriptorImpl(WebComponentDescriptor other)
The copy constructor.
-
-
Method Detail
-
getInitializationParameterSet
public Set<InitializationParameter> getInitializationParameterSet()
- Specified by:
getInitializationParameterSetin classWebComponentDescriptor
-
getInitializationParameters
public Enumeration<InitializationParameter> getInitializationParameters()
- Specified by:
getInitializationParametersin classWebComponentDescriptor- Returns:
- the Set of servlet initialization parameters.
-
getInitializationParameterByName
public InitializationParameter getInitializationParameterByName(String name)
- Specified by:
getInitializationParameterByNamein classWebComponentDescriptor- Parameters:
name-- Returns:
- a matching initialization parameter by its name if there is one.
-
addInitializationParameter
public void addInitializationParameter(InitializationParameter initializationParameter)
Adds a servlet initialization parameter to this component.- Specified by:
addInitializationParameterin classWebComponentDescriptor- Parameters:
initializationParameter-
-
removeInitializationParameter
public void removeInitializationParameter(InitializationParameter initializationParameter)
Removes the given servlet initialization parameter from this component.- Specified by:
removeInitializationParameterin classWebComponentDescriptor- Parameters:
initializationParameter-
-
getConflictedInitParameterNames
public Set<String> getConflictedInitParameterNames()
- Specified by:
getConflictedInitParameterNamesin classWebComponentDescriptor
-
getUrlPatternsSet
public Set<String> getUrlPatternsSet()
- Specified by:
getUrlPatternsSetin classWebComponentDescriptor- Returns:
- the set of URL pattern aliases for this component.
-
getUrlPatterns
public Enumeration<String> getUrlPatterns()
- Specified by:
getUrlPatternsin classWebComponentDescriptor- Returns:
- an enumeration of (String) URL pattern aliases for this component.
-
addUrlPattern
public void addUrlPattern(String urlPattern)
Adds an alias to this web component.- Specified by:
addUrlPatternin classWebComponentDescriptor- Parameters:
urlPattern-
-
removeUrlPattern
public void removeUrlPattern(String urlPattern)
Removes a URL pattern from this web component.- Specified by:
removeUrlPatternin classWebComponentDescriptor- Parameters:
urlPattern-
-
setWebBundleDescriptor
public void setWebBundleDescriptor(WebBundleDescriptor webBundleDescriptor)
- Specified by:
setWebBundleDescriptorin classWebComponentDescriptor
-
getWebBundleDescriptor
public WebBundleDescriptor getWebBundleDescriptor()
- Specified by:
getWebBundleDescriptorin classWebComponentDescriptor- Returns:
- the web app object to which this object belongs
-
getCanonicalName
public String getCanonicalName()
The canonical name for the web component.- Specified by:
getCanonicalNamein classWebComponentDescriptor- Returns:
-
setCanonicalName
public void setCanonicalName(String canonicalName)
Sets the canonical name of this web component.- Specified by:
setCanonicalNamein classWebComponentDescriptor- Parameters:
canonicalName-
-
getLoadOnStartUp
public Integer getLoadOnStartUp()
- Specified by:
getLoadOnStartUpin classWebComponentDescriptor- Returns:
- the order on which this component will be loaded by the web server.
-
setLoadOnStartUp
public void setLoadOnStartUp(Integer loadOnStartUp)
Sets the order on which this component will be loaded by the web server.- Specified by:
setLoadOnStartUpin classWebComponentDescriptor- Parameters:
loadOnStartUp-
-
setLoadOnStartUp
public void setLoadOnStartUp(String loadOnStartUp) throws NumberFormatException
Sets the order on which this component will be loaded by the web server.- Specified by:
setLoadOnStartUpin classWebComponentDescriptor- Parameters:
loadOnStartUp-- Throws:
NumberFormatException
-
getSecurityRoleReferenceSet
public Set<SecurityRoleReference> getSecurityRoleReferenceSet()
- Specified by:
getSecurityRoleReferenceSetin classWebComponentDescriptor
-
getSecurityRoleReferences
public Enumeration<SecurityRoleReference> getSecurityRoleReferences()
- Specified by:
getSecurityRoleReferencesin classWebComponentDescriptor- Returns:
- the Set of security role references that I have.
-
getSecurityRoleReferenceByName
public SecurityRoleReference getSecurityRoleReferenceByName(String roleReferenceName)
- Specified by:
getSecurityRoleReferenceByNamein classWebComponentDescriptor- Parameters:
roleReferenceName-- Returns:
- a matching role reference by name or null if there is none matching.
-
addSecurityRoleReference
public void addSecurityRoleReference(SecurityRoleReference securityRoleReference)
Adds a security role reference to this web component.- Specified by:
addSecurityRoleReferencein classWebComponentDescriptor- Parameters:
securityRoleReference-
-
removeSecurityRoleReference
public void removeSecurityRoleReference(SecurityRoleReference securityRoleReference)
Removes the given security role reference from this web component.- Specified by:
removeSecurityRoleReferencein classWebComponentDescriptor- Parameters:
securityRoleReference-
-
setRunAsIdentity
public void setRunAsIdentity(RunAsIdentityDescriptor runAs)
Sets the run-as of the referee EJB.- Specified by:
setRunAsIdentityin classWebComponentDescriptor- Parameters:
runAs- the value of run-as
-
getRunAsIdentity
public RunAsIdentityDescriptor getRunAsIdentity()
Gets the run-as of the referee EJB.- Specified by:
getRunAsIdentityin classWebComponentDescriptor- Returns:
- the value of run-as.
-
getUsesCallerIdentity
public boolean getUsesCallerIdentity()
- Specified by:
getUsesCallerIdentityin classWebComponentDescriptor
-
setUsesCallerIdentity
public void setUsesCallerIdentity(boolean isCallerID)
- Specified by:
setUsesCallerIdentityin classWebComponentDescriptor
-
getMultipartConfig
public MultipartConfig getMultipartConfig()
- Specified by:
getMultipartConfigin classWebComponentDescriptor
-
setMultipartConfig
public void setMultipartConfig(MultipartConfig multipartConfig)
- Specified by:
setMultipartConfigin classWebComponentDescriptor
-
setMultipartConfig
public void setMultipartConfig(MultipartConfigDescriptor multipartConfigDesc)
DeploymentDescriptorNode.addNodeDescriptor(node) need this.- Parameters:
multipartConfigDesc-
-
getApplication
public Application getApplication()
- Specified by:
getApplicationin classWebComponentDescriptor
-
setWebComponentImplementation
public void setWebComponentImplementation(String implFile)
sets the implementation file for this web component, the implementation file is either a servlet class name of a jsp file name.- Specified by:
setWebComponentImplementationin classWebComponentDescriptor- Parameters:
implFile- the servlet class name or the jsp file
-
getWebComponentImplementation
public String getWebComponentImplementation()
- Specified by:
getWebComponentImplementationin classWebComponentDescriptor
-
isServlet
public boolean isServlet()
- Specified by:
isServletin classWebComponentDescriptor
-
setServlet
public void setServlet(boolean isServlet)
- Specified by:
setServletin classWebComponentDescriptor
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin classWebComponentDescriptor
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabledin classWebComponentDescriptor
-
setAsyncSupported
public void setAsyncSupported(Boolean asyncSupported)
- Specified by:
setAsyncSupportedin classWebComponentDescriptor
-
isAsyncSupported
public Boolean isAsyncSupported()
- Specified by:
isAsyncSupportedin classWebComponentDescriptor
-
setConflict
public void setConflict(boolean conflict)
- Specified by:
setConflictin classWebComponentDescriptor
-
isConflict
public boolean isConflict()
- Specified by:
isConflictin classWebComponentDescriptor
-
getUserDefinedHttpMethods
public Method[] getUserDefinedHttpMethods()
This method return an array of user defined http doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace methods. It is used for processing web security annotations.- Specified by:
getUserDefinedHttpMethodsin classWebComponentDescriptor- Returns:
- an array of methods.
-
print
public void print(StringBuilder toStringBuilder)
A formatted string representing my state.- Overrides:
printin classDescriptor- Parameters:
toStringBuilder-
-
equals
public boolean equals(Object other)
- Specified by:
equalsin classWebComponentDescriptor
-
hashCode
public int hashCode()
- Specified by:
hashCodein classWebComponentDescriptor
-
add
public void add(WebComponentDescriptor other)
- Specified by:
addin classWebComponentDescriptor
-
add
public void add(WebComponentDescriptor other, boolean combineUrlPatterns, boolean combineConflict)
this method will combine the information from this "other" // WebComponentDescriptor with current WebComponentDescriptor // // when there are conflicts between the contents of the two, // the value from current WebComponentDescriptor will override // the value in "other" // // Note: in the Set API, we only add value when such value // is not existed in the Set already // // If combineUrlPatterns is false, then the first one take priority, // otherwise take the second one. // // If combineConflict is true, it will combine the init parameter // conflict information in #getConflictedInitParameterSet. // // And the conflict boolean will not be set.- Specified by:
addin classWebComponentDescriptor- Parameters:
other-combineUrlPatterns-combineConflict-
-
isConflict
public boolean isConflict(WebComponentDescriptor other, boolean allowNullImplNameOverride)
- Specified by:
isConflictin classWebComponentDescriptor
-
-