Fields Summary |
---|
private WebBundleDescriptor | webBundleDescriptor |
public static final String | BASIC_AUTHENTICATIONConstant for Basic authentication. |
public static final String | FORM_AUTHENTICATIONConstant for Form authentication. |
public static final String | SSL_AUTHENTICATIONConstant for Secure authentication. |
public static final String | GETConstant for the htpp GET method. |
public static final String | PUTConstant for the http PUT method. |
public static final String | POSTConstant for the http POST method. |
public static final String | DELETEConstant for the http DELET method. |
private Set | initializationParameters |
private Set | urlPatterns |
private String | canonicalName |
private int | loadOnStartUp |
private Set | securityRoleReferences |
private RunAsIdentityDescriptor | runAs |
private String | implFile |
private boolean | isServlet |
Methods Summary |
---|
public void | add(com.sun.enterprise.deployment.WebComponentDescriptor other)
// do not do anything if the canonical name of the two web
// components are different
if (! getCanonicalName().equals(other.getCanonicalName())) {
return;
}
// do not do anything if the type of the two web
// components are different
if ( (isServlet() && !other.isServlet()) ||
(!isServlet() && other.isServlet()) ) {
return;
}
// for simple String types, we can rely on Set API
getUrlPatternsSet().addAll(other.getUrlPatternsSet());
// for complex types, only added it if the complex type with same
// name is not in the set yet
for (Iterator initParamIter =
other.getInitializationParameterSet().iterator();
initParamIter.hasNext();) {
InitializationParameter initParam =
(InitializationParameter)initParamIter.next();
if (getInitializationParameterByName(initParam.getName()) == null) {
getInitializationParameterSet().add(initParam);
}
}
for (Iterator secRoleRefIter =
other.getSecurityRoleReferenceSet().iterator();
secRoleRefIter.hasNext();) {
SecurityRoleReference secRoleRef =
(SecurityRoleReference) secRoleRefIter.next();
if (getSecurityRoleReferenceByName(secRoleRef.getRolename())
== null) {
getSecurityRoleReferenceSet().add(secRoleRef);
}
}
// only set these values if they are not set in the current
// web component already
if (getLoadOnStartUp() == -1) {
setLoadOnStartUp(other.getLoadOnStartUp());
}
if (getRunAsIdentity() == null) {
setRunAsIdentity(other.getRunAsIdentity());
}
if (getWebComponentImplementation() == null) {
setWebComponentImplementation(
other.getWebComponentImplementation());
}
|
public void | addInitializationParameter(com.sun.enterprise.deployment.web.InitializationParameter initializationParameter)Adds a servlet initialization parameter to this component.
this.getInitializationParameterSet().add(initializationParameter);
this.changed();
|
public void | addSecurityRoleReference(com.sun.enterprise.deployment.web.SecurityRoleReference securityRoleReference)Adds a security role reference to this web component.
this.getSecurityRoleReferenceSet().add(securityRoleReference);
this.changed();
|
public void | addUrlPattern(java.lang.String urlPattern)Adds an alias to this web component.
this.getUrlPatternsSet().add(urlPattern);
this.changed();
|
public void | changed()
if (this.getWebBundleDescriptor() != null) {
this.getWebBundleDescriptor().changed();
} else {
super.changed();
}
|
public boolean | equals(java.lang.Object other)
if (other instanceof WebComponentDescriptor &&
this.getCanonicalName().equals(((
WebComponentDescriptor)other).getCanonicalName())) {
return true;
}
return false;
|
public Application | getApplication()
if (this.getWebBundleDescriptor()!=null) {
return this.getWebBundleDescriptor().getApplication();
}
return null;
|
public java.lang.String | getCanonicalName()The canonical name for the web component.
if (this.canonicalName == null) {
this.canonicalName = this.getName();
}
return this.canonicalName;
|
public com.sun.enterprise.deployment.web.InitializationParameter | getInitializationParameterByName(java.lang.String name)Return a matching initialization parameter by its name if there is one.
for (Iterator itr = this.getInitializationParameterSet().iterator(); itr.hasNext();) {
InitializationParameter next = (InitializationParameter) itr.next();
if (next.getName().equals(name)) {
return next;
}
}
return null;
|
private java.util.Set | getInitializationParameterSet()
if (this.initializationParameters == null) {
this.initializationParameters = new OrderedSet();
}
return this.initializationParameters = new OrderedSet(this.initializationParameters);
|
public java.util.Enumeration | getInitializationParameters()Return the Set of servlet initialization parameters.
return (new Vector(this.getInitializationParameterSet())).elements();
|
public int | getLoadOnStartUp()Return the order on which this component will be loaded by the web server.
return this.loadOnStartUp;
|
public RunAsIdentityDescriptor | getRunAsIdentity()Sets the run-as of the referee EJB.
return this.runAs;
|
public com.sun.enterprise.deployment.web.SecurityRoleReference | getSecurityRoleReferenceByName(java.lang.String roleReferenceName)Return a matching role reference by name or null if there is none matching.
for (Enumeration e = this.getSecurityRoleReferences(); e.hasMoreElements();) {
SecurityRoleReference nextRR = (SecurityRoleReference) e.nextElement();
if (nextRR.getRolename().equals( roleReferenceName )) {
return nextRR;
}
}
return null;
|
java.util.Set | getSecurityRoleReferenceSet()
if (this.securityRoleReferences == null) {
this.securityRoleReferences = new OrderedSet();
}
return this.securityRoleReferences = new OrderedSet(this.securityRoleReferences);
|
public java.util.Enumeration | getSecurityRoleReferences()Return the Set of security role references that I have.
return (new Vector(this.getSecurityRoleReferenceSet())).elements();
|
public java.util.Enumeration | getUrlPatterns()Returns an enumeration of (String) URL pattern aliases for this component.
return (new Vector(this.getUrlPatternsSet())).elements();
|
public java.util.Set | getUrlPatternsSet()Return the set of URL pattern aliases for this component.
if (this.urlPatterns == null) {
this.urlPatterns = new OrderedSet();
}
return this.urlPatterns;
|
public boolean | getUsesCallerIdentity()
return (this.runAs==null);
|
public WebBundleDescriptor | getWebBundleDescriptor()Return the web app object to which I belong or null
return this.webBundleDescriptor;
|
public java.lang.String | getWebComponentImplementation()
return implFile;
|
public int | hashCode()
int result = 17;
result = 37*result + getCanonicalName().hashCode();
return result;
|
public boolean | isServlet()
return isServlet;
|
public void | print(java.lang.StringBuffer toStringBuffer)A formatted string representing my state.
super.print(toStringBuffer);
toStringBuffer.append("WebComponentDescriptor\n");
toStringBuffer.append( "\n initializationParameters ").append(initializationParameters);
toStringBuffer.append( "\n urlPatterns ").append(urlPatterns);
toStringBuffer.append( "\n canonicalName ").append(canonicalName);
toStringBuffer.append( "\n loadOnStartUp ").append(loadOnStartUp);
toStringBuffer.append( "\n securityRoleReferences ").append(securityRoleReferences);
if (isServlet()) {
toStringBuffer.append( "\n servlet className ").append(getWebComponentImplementation());
} else {
toStringBuffer.append( "\n jspFileName ").append(getWebComponentImplementation());
}
|
public void | removeInitializationParameter(com.sun.enterprise.deployment.web.InitializationParameter initializationParameter)Removes the given servlet initialization parameter from this component.
this.getInitializationParameterSet().remove(initializationParameter);
this.changed();
|
public void | removeSecurityRoleReference(com.sun.enterprise.deployment.web.SecurityRoleReference securityRoleReference)Removes the given security role reference from this web component.
this.getSecurityRoleReferenceSet().remove(securityRoleReference);
this.changed();
|
public void | removeUrlPattern(java.lang.String urlPattern)Removes a URL pattern from this web component.
this.getUrlPatternsSet().remove(urlPattern);
this.changed();
|
public void | setCanonicalName(java.lang.String canonicalName)Sets the canonical name of this web component.
this.canonicalName = canonicalName;
this.changed();
|
public void | setLoadOnStartUp(int loadOnStartUp)Sets the order on which this component will be loaded by the web server.
this.loadOnStartUp = loadOnStartUp;
this.changed();
|
public void | setLoadOnStartUp(java.lang.String loadOnStartUp)Sets the order on which this component will be loaded by the web server.
this.loadOnStartUp = Integer.decode(loadOnStartUp).intValue();
this.changed();
|
public void | setRunAsIdentity(RunAsIdentityDescriptor runAs)Gets the run-as of the referee EJB.
if (this.runAs == null) {
this.runAs = runAs;
}
|
public void | setServlet(boolean isServlet)
this.isServlet=isServlet;
|
public void | setUsesCallerIdentity(boolean isCallerID)
if (isCallerID) {
this.runAs = null;
} else {
this.runAs = new RunAsIdentityDescriptor("");
}
|
void | setWebBundleDescriptor(WebBundleDescriptor webBundleDescriptor)
this.webBundleDescriptor = webBundleDescriptor;
|
public void | setWebComponentImplementation(java.lang.String implFile)sets the implementation file for this web component, the
implementation file is either a servlet class name of a jsp
file name.
if (!isServlet && !implFile.startsWith("/")) {
implFile = "/" + implFile;
}
this.implFile = implFile;
changed();
|