FileDocCategorySizeDatePackage
WebBundleDescriptor.javaAPI DocGlassfish v2 API54616Fri May 04 22:31:24 BST 2007None

WebBundleDescriptor

public class WebBundleDescriptor extends BundleDescriptor implements com.sun.enterprise.deployment.types.MessageDestinationReferenceContainer, com.sun.enterprise.deployment.types.ResourceReferenceContainer, com.sun.enterprise.deployment.types.ServiceReferenceContainer, com.sun.enterprise.deployment.types.ResourceEnvReferenceContainer, WritableJndiNameEnvironment, com.sun.enterprise.deployment.types.EjbReferenceContainer, com.sun.enterprise.util.NotificationListener
I am an object that represents all the deployment information about a web app [{0}]lication.
author
Danny Coward

Fields Summary
private Set
webComponentDescriptors
private int
sessionTimeout
private Set
mimeMappings
private Set
welcomeFiles
private Set
errorPageDescriptors
private Vector
appListenerDescriptors
private Set
contextParameters
private Set
ejbReferences
private Set
resourceReferences
private Set
jmsDestReferences
private Set
messageDestReferences
private Set
serviceReferences
private Set
postConstructDescs
private Set
preDestroyDescs
private Set
entityManagerFactoryReferences
private Set
entityManagerReferences
private boolean
isDistributable
private Set
securityRoles
private Set
securityConstraints
private String
contextRoot
private com.sun.enterprise.deployment.web.LoginConfiguration
loginConfiguration
private Set
environmentEntries
private LocaleEncodingMappingListDescriptor
localeEncodingMappingDesc
private JspConfigDescriptor
jspConfigDescriptor
private Vector
servletFilters
private Vector
servletFilterMappings
public static final int
SESSION_TIMEOUT_DEFAULT
private static final String
DEPLOYMENT_DESCRIPTOR_DIR
private static com.sun.enterprise.util.LocalStringManagerImpl
localStrings
private com.sun.enterprise.deployment.runtime.web.SunWebApp
sunWebApp
Constructors Summary
public WebBundleDescriptor()
Constrct an empty web app [{0}].

   
              
      
        sessionTimeout = SESSION_TIMEOUT_DEFAULT;
    
Methods Summary
public voidaddAppListenerDescriptor(com.sun.enterprise.deployment.web.AppListenerDescriptor ref)

	if (!this.getAppListeners().contains(ref)) {
	    this.getAppListeners().addElement(ref);
	    this.changed();
	}
    
public voidaddAppListenerDescriptor(AppListenerDescriptorImpl ref)

    
        addAppListenerDescriptor((AppListenerDescriptor) ref);
    
public voidaddContextParameter(com.sun.enterprise.deployment.web.ContextParameter contextParameter)
Adds a new context parameter to my list.

	this.getContextParametersSet().add(contextParameter);
	this.changed();
    
public voidaddContextParameter(EnvironmentProperty contextParameter)
Adds a new context parameter to my list.

        addContextParameter((ContextParameter) contextParameter);
    
public voidaddEjbReferenceDescriptor(com.sun.enterprise.deployment.types.EjbReference ejbReference)
Adds a new reference to an ejb.

	this.getEjbReferenceDescriptors().add(ejbReference);        
        ejbReference.setReferringBundleDescriptor(this);        	
        this.changed();
    
public voidaddEjbReferenceDescriptor(EjbReferenceDescriptor ejbReferenceDescriptor)
Adds a new reference to an ejb.

	this.addEjbReferenceDescriptor((EjbReference) ejbReferenceDescriptor);

    
public voidaddEntityManagerFactoryReferenceDescriptor(EntityManagerFactoryReferenceDescriptor reference)

 
        reference.setReferringBundleDescriptor(this);
        this.getEntityManagerFactoryReferenceDescriptors().add(reference);
        this.changed();
    
public voidaddEntityManagerReferenceDescriptor(EntityManagerReferenceDescriptor reference)

 
        reference.setReferringBundleDescriptor(this);
        this.getEntityManagerReferenceDescriptors().add(reference);
        this.changed();
    
public voidaddEnvironmentEntry(com.sun.enterprise.deployment.web.EnvironmentEntry environmentEntry)
Adds this given environment property to my list.

	this.getEnvironmentEntrySet().add(environmentEntry);
	this.changed();
    
public voidaddEnvironmentProperty(EnvironmentProperty environmentProperty)
Adds this given environment property to my list.

	this.getEnvironmentEntrySet().add(environmentProperty);
	this.changed();
    
public voidaddErrorPageDescriptor(com.sun.enterprise.deployment.web.ErrorPageDescriptor errorPageDescriptor)
Adds a new error page to my list.

	this.getErrorPageDescriptorsSet().add(errorPageDescriptor);
	this.changed();
    
public voidaddErrorPageDescriptor(ErrorPageDescriptorImpl errorPageDescriptor)

	addErrorPageDescriptor((ErrorPageDescriptor) errorPageDescriptor);
    
public voidaddJmsDestinationReferenceDescriptor(JmsDestinationReferenceDescriptor jmsDestReference)

	this.getJmsDestinationReferenceDescriptors().add(jmsDestReference);
	this.changed();
    
public voidaddLocaleEncodingMappingListDescriptor(LocaleEncodingMappingListDescriptor lemDesc)

	localeEncodingMappingDesc = lemDesc;
    
public voidaddMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor messageDestRef)

 
        messageDestRef.setReferringBundleDescriptor(this);
        this.getMessageDestinationReferenceDescriptors().add(messageDestRef);
        this.changed();
    
public voidaddMimeMapping(com.sun.enterprise.deployment.web.MimeMapping mimeMapping)
Adds the given mime mapping to my list.

        // always override
        // Since Set.add API doesn't replace
        // remove the element first if it's already contained
	for (Iterator itr = getMimeMappingsSet().iterator(); itr.hasNext();) {
	    MimeMapping mm = (MimeMapping) itr.next();
	    if (mm.getExtension().equals(mimeMapping.getExtension())) {
		getMimeMappingsSet().remove(mm);   
                break;
	    }
        }
	this.getMimeMappingsSet().add(mimeMapping);
	this.changed();
    
public voidaddMimeMapping(MimeMappingDescriptor mimeMapping)
Adds the given mime mapping to my list.

        addMimeMapping((MimeMapping) mimeMapping);
    
public voidaddPostConstructDescriptor(LifecycleCallbackDescriptor postConstructDesc)

        String className = postConstructDesc.getLifecycleCallbackClass();
        boolean found = false;
        for (LifecycleCallbackDescriptor next :
             getPostConstructDescriptors()) {
            if (next.getLifecycleCallbackClass().equals(className)) {
                found = true;
                break;
            }
        }
        if (!found) {
            getPostConstructDescriptors().add(postConstructDesc);
        }
    
public voidaddPreDestroyDescriptor(LifecycleCallbackDescriptor preDestroyDesc)

        String className = preDestroyDesc.getLifecycleCallbackClass();
        boolean found = false;
        for (LifecycleCallbackDescriptor next :
             getPreDestroyDescriptors()) {
            if (next.getLifecycleCallbackClass().equals(className)) {
                found = true;
                break;
            }
        }
        if (!found) {
            getPreDestroyDescriptors().add(preDestroyDesc);
        }
    
public voidaddResourceReference(com.sun.enterprise.deployment.web.ResourceReference resourceReference)
adds a new reference to a resource.

	this.getResourceReferenceDescriptors().add(resourceReference);
	this.changed();
    
public voidaddResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)
adds a new reference to a resource.

	this.addResourceReference((ResourceReference) resourceReference);
    
public voidaddSecurityConstraint(com.sun.enterprise.deployment.web.SecurityConstraint securityConstraint)
Add a new security constraint.

	this.getSecurityConstraintsSet().add(securityConstraint);
	this.changed();
    
public voidaddSecurityConstraint(SecurityConstraintImpl securityConstraint)
Add a new security constraint.

	addSecurityConstraint((SecurityConstraint )securityConstraint);
    
public voidaddSecurityRole(com.sun.enterprise.deployment.web.SecurityRole securityRole)
Add a new abstrct role to me.

	Role r = new Role(securityRole.getName());
	r.setDescription(securityRole.getDescription());
	super.addRole(r);
    
public voidaddSecurityRole(SecurityRoleDescriptor securityRole)
Add a new abstrct role to me.

    
        addSecurityRole((SecurityRole) securityRole);
    
public voidaddServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)

        serviceRef.setBundleDescriptor(this);
        this.getServiceReferenceDescriptors().add(serviceRef);
        this.changed();
    
public voidaddServletFilter(com.sun.enterprise.deployment.web.ServletFilter ref)
Adds a servlet filter to this web component.

	if (!this.getServletFilters().contains(ref)) {
	    this.getServletFilters().addElement(ref);
	    this.changed();
	}
    
public voidaddServletFilter(ServletFilterDescriptor ref)

        addServletFilter((ServletFilter) ref);
    
public voidaddServletFilterMapping(com.sun.enterprise.deployment.web.ServletFilterMapping ref)
Adds a servlet filter mapping to this web component.

	if (!this.getServletFilterMappings().contains(ref)) {
	    this.getServletFilterMappings().addElement(ref);
	    this.changed();
	}
    
public voidaddServletFilterMapping(ServletFilterMappingDescriptor ref)
Adds a servlet filter mapping to this web component.

        addServletFilterMapping((ServletFilterMapping) ref);
    
public voidaddWebBundleDescriptor(com.sun.enterprise.deployment.WebBundleDescriptor webBundleDescriptor)

	super.addBundleDescriptor(webBundleDescriptor);

	// mdf - #4400074 ejb added to existing ejb-jar in wizard has wrong bundle
	// (this problem occured for WebComponents as well)
	//this.getWebComponentDescriptorsSet().addAll(webBundleDescriptor.getWebComponentDescriptorsSet());
	for (Iterator itr = webBundleDescriptor.getWebComponentDescriptorsSet().iterator(); itr.hasNext();) {
	    WebComponentDescriptor webComponentDescriptor = 
                new WebComponentDescriptor((WebComponentDescriptor)itr.next());
	    webComponentDescriptor.setWebBundleDescriptor(this);
	    this.getWebComponentDescriptorsSet().add(webComponentDescriptor);
	}

	this.getMimeMappingsSet().addAll(webBundleDescriptor.getMimeMappingsSet());
	this.getWelcomeFilesSet().addAll(webBundleDescriptor.getWelcomeFilesSet());
	this.getErrorPageDescriptorsSet().addAll(webBundleDescriptor.getErrorPageDescriptorsSet());
	this.getAppListeners().addAll(webBundleDescriptor.getAppListeners());
	this.getContextParametersSet().addAll(webBundleDescriptor.getContextParametersSet());
	this.getEjbReferenceDescriptors().addAll(webBundleDescriptor.getEjbReferenceDescriptors());
	this.getResourceReferenceDescriptors().addAll(webBundleDescriptor.getResourceReferenceDescriptors());
        this.getMessageDestinationReferenceDescriptors().addAll(webBundleDescriptor.getMessageDestinationReferenceDescriptors());
	this.getServiceReferenceDescriptors().addAll(webBundleDescriptor.getServiceReferenceDescriptors());
	this.getEnvironmentProperties().addAll(webBundleDescriptor.getEnvironmentProperties());
	this.getSecurityConstraintsSet().addAll(webBundleDescriptor.getSecurityConstraintsSet());

	// ServletFilters
	// mdf - #4399820 Servlet Filters and their mapping don't appear in inspector
	this.getServletFilters().addAll(webBundleDescriptor.getServletFilters());
	this.getServletFilterMappings().addAll(webBundleDescriptor.getServletFilterMappings());
	this.setLocaleEncodingMappingListDescriptor(webBundleDescriptor.getLocaleEncodingMappingListDescriptor());
	this.setJspConfigDescriptor(webBundleDescriptor.getJspConfigDescriptor());

	// WebServices
	WebServicesDescriptor thisWebServices = this.getWebServices();
	WebServicesDescriptor otherWebServices = webBundleDescriptor.getWebServices();
	for (Iterator i = otherWebServices.getWebServices().iterator(); i.hasNext();) {
	    WebService ws = (WebService)i.next();
	    thisWebServices.addWebService(new WebService(ws));
	}

	this.changed();
    
public voidaddWebComponentDescriptor(WebComponentDescriptor webComponentDescriptor)
Adds a new Web Component Descriptor to me.

	((WebComponentDescriptor) webComponentDescriptor).setWebBundleDescriptor(this);
        for (Iterator wcdIter = getWebComponentDescriptorsSet().iterator(); 
            wcdIter.hasNext();) {
            WebComponentDescriptor wbd = (WebComponentDescriptor)wcdIter.next();
            if (wbd.getCanonicalName().equals(
                webComponentDescriptor.getCanonicalName())) {
                // combine the contents of the two
                webComponentDescriptor.add(wbd);
                // remove the original one from the set
                // so we can add the new one
                getWebComponentDescriptorsSet().remove(wbd);
                break;
            }
        }
	this.getWebComponentDescriptorsSet().add(webComponentDescriptor);
	this.changed();
    
public voidaddWelcomeFile(java.lang.String fileUri)
Adds a new welcome file to my list.

	this.getWelcomeFilesSet().add(fileUri);
	this.changed();
    
public java.util.CollectionfindReferencedPUs()
{@inheritDoc}

        Collection<PersistenceUnitDescriptor> pus =
                new HashSet<PersistenceUnitDescriptor>(
                        findReferencedPUsViaPURefs(this));
        pus.addAll(findReferencedPUsViaPCRefs(this));
        return pus;
    
public java.util.VectorgetAppListenerDescriptors()

	return (Vector)this.getAppListeners().clone(); 
    
private java.util.VectorgetAppListeners()

	if (this.appListenerDescriptors == null) {
	    this.appListenerDescriptors = new Vector();
	}
	return this.appListenerDescriptors;
    
public java.util.EnumerationgetContextParameters()
Returns my COntext Parameters in an enumeration.

	return (new Vector(this.getContextParametersSet())).elements();
    
public java.util.SetgetContextParametersSet()
Returns the Set og my COntext Parameters.

	if (this.contextParameters == null) {
	    this.contextParameters = new OrderedSet();
	}
	return this.contextParameters = new OrderedSet(this.contextParameters);
    
public java.lang.StringgetContextRoot()
return the name of my context root

        if (getModuleDescriptor()!=null && getModuleDescriptor().getContextRoot()!=null) {
            return getModuleDescriptor().getContextRoot();
        }        
	if (this.contextRoot == null) {
	    this.contextRoot = "";
	}
	return this.contextRoot;
    
public java.lang.StringgetDefaultSpecVersion()

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

        return WebBundleNode.SPEC_VERSION;
    
public java.lang.StringgetDeploymentDescriptorDir()

return
the deployment descriptor directory location inside the archive file

        return DEPLOYMENT_DESCRIPTOR_DIR;
    
public com.sun.enterprise.deployment.types.EjbReferencegetEjbReference(java.lang.String name)

	for (Iterator itr = this.getEjbReferenceDescriptors().iterator(); itr.hasNext();) {
	    EjbReference er = (EjbReference) itr.next();
	    if (er.getName().equals(name)) {
		return er;   
	    }
	}
	throw new IllegalArgumentException(localStrings.getLocalString(
							      "enterprise.deployment.exceptionwebapphasnoejbrefbyname",
							      "This web app [{0}] has no ejb reference by the name of [{1}] ", new Object[] {getName(), name}));
    
public EjbReferenceDescriptorgetEjbReferenceByName(java.lang.String name)
Returns an Enterprise Bean with the matching name or throw.

        return (EjbReferenceDescriptor) getEjbReference(name);
    
public java.util.SetgetEjbReferenceDescriptors()
Returns the Set of my references to Enterprise Beans.

	if (this.ejbReferences == null) {
	    this.ejbReferences = new OrderedSet();
	}
	return this.ejbReferences = new OrderedSet(this.ejbReferences);
    
public java.util.EnumerationgetEjbReferences()
Returns the enumeration of my references to Enterprise Beans.

	return (new Vector(this.getEjbReferenceDescriptors())).elements();
    
public EntityManagerFactoryReferenceDescriptorgetEntityManagerFactoryReferenceByName(java.lang.String name)
Return the entity manager factory reference descriptor corresponding to the given name.

	for (EntityManagerFactoryReferenceDescriptor next :
             getEntityManagerFactoryReferenceDescriptors()) {

	    if (next.getName().equals(name)) {
		return next;
	    }
	}
        throw new IllegalArgumentException(localStrings.getLocalString(
            "exceptionwebapphasnoentitymgrfactoryrefbyname",
            "This web app [{0}] has no entity manager factory reference by the name of [{1}]",
            new Object[] {getName(), name}));
    
public java.util.SetgetEntityManagerFactoryReferenceDescriptors()

        return entityManagerFactoryReferences;
    
public EntityManagerReferenceDescriptorgetEntityManagerReferenceByName(java.lang.String name)
Return the entity manager factory reference descriptor corresponding to the given name.

	for (EntityManagerReferenceDescriptor next :
             getEntityManagerReferenceDescriptors()) {

	    if (next.getName().equals(name)) {
		return next;
	    }
	}
        throw new IllegalArgumentException(localStrings.getLocalString(
            "exceptionwebapphasnoentitymgrrefbyname",
            "This web app [{0}] has no entity manager reference by the name of [{1}]",
            new Object[] {getName(), name}));
    
public java.util.SetgetEntityManagerReferenceDescriptors()

        return entityManagerReferences;
    
public java.util.EnumerationgetEnvironmentEntries()
Return my set of environment properties.

	return (new Vector(this.getEnvironmentEntrySet())).elements();
    
private java.util.SetgetEnvironmentEntrySet()

	if (this.environmentEntries == null) {
	    this.environmentEntries = new OrderedSet();
	}
	return this.environmentEntries = new OrderedSet(environmentEntries);
    
public java.util.SetgetEnvironmentProperties()
Return my set of environment properties.

	return this.getEnvironmentEntrySet();
    
public EnvironmentPropertygetEnvironmentPropertyByName(java.lang.String name)
Returns the environment property object searching on the supplied key. throws an illegal argument exception if no such environment property exists.

	for (Iterator itr = this.getEnvironmentEntrySet().iterator(); 
             itr.hasNext();) {
	    EnvironmentProperty ev = (EnvironmentProperty) itr.next();
	    if (ev.getName().equals(name)) {
		return ev;   
	    }
	}
	throw new IllegalArgumentException(localStrings.getLocalString(
		"enterprise.deployment.exceptionwebapphasnoenvpropertybyname",
		"This web app [{0}] has no environment property by the name of [{1}]", 
                new Object[] {getName(), name}));
    
public com.sun.enterprise.deployment.web.ErrorPageDescriptorgetErrorPageDescriptorBySignifier(java.lang.String signifier)
Search my error pages for one with thei given signifier or null if there isn't one.

	for (Iterator itr = this.getErrorPageDescriptorsSet().iterator(); itr.hasNext();) {
	    ErrorPageDescriptorImpl next = (ErrorPageDescriptorImpl) itr.next();
	    if (next.getErrorSignifierAsString().equals(signifier)) {
		return next;
	    }
	}
	return null;
    
public java.util.EnumerationgetErrorPageDescriptors()
Returns an enumeration of the error pages I have.

	return (new Vector(this.getErrorPageDescriptorsSet())).elements();
    
private java.util.SetgetErrorPageDescriptorsSet()

	if (this.errorPageDescriptors == null) {
	    this.errorPageDescriptors = new HashSet();
	}
	return this.errorPageDescriptors;
    
protected java.util.ListgetInjectableResourcesByClass(java.lang.String className, JndiNameEnvironment jndiNameEnv)

        List<InjectionCapable> injectables = 
            new LinkedList<InjectionCapable>();

        for(InjectionCapable next : getInjectableResources(jndiNameEnv) ) {
            if( next.isInjectable()) {
                for (InjectionTarget target : next.getInjectionTargets()) {
                    if (target.getClassName().equals(className) ) {
                        injectables.add(next);
                    }
                }
            }
        }
        
        if(((WebBundleDescriptor)jndiNameEnv).hasWebServices()) {
            // Add @Resource WebServiceContext present in endpoint impl class to the list of
            // injectable resources; We do this for servelt endpoint only because the actual 
            // endpoint impl class gets replaced by JAXWSServlet in web.xml and hence
            // will never be added as an injectable resource
            for(InjectionCapable next : getInjectableResources(this) ) {
                if( next.isInjectable()) {
                    for (InjectionTarget target : next.getInjectionTargets()) {
                        Iterator<WebServiceEndpoint> epIter = getWebServices().getEndpoints().iterator();
                        while(epIter.hasNext()) {
                            String servletImplClass = epIter.next().getServletImplClass();
                            if (target.getClassName().equals(servletImplClass) ) {
                                injectables.add(next);
                            }
                        }
                    }
                }
            }
        }
        return injectables;
    
public java.util.ListgetInjectableResourcesByClass(java.lang.String className)

        return(getInjectableResourcesByClass(className, this));
    
public InjectionInfogetInjectionInfoByClass(java.lang.String className)

        return(getInjectionInfoByClass(className, this));
    
public JmsDestinationReferenceDescriptorgetJmsDestinationReferenceByName(java.lang.String name)
Return a JMS destination reference by the same name or throw an IllegalArgumentException.

	for (Iterator itr = this.getJmsDestinationReferenceDescriptors().iterator(); itr.hasNext();) {
	    JmsDestinationReferenceDescriptor jdr = (JmsDestinationReferenceDescriptor) itr.next();
	    if (jdr.getName().equals(name)) {
		return jdr;   
	    }
	}
	throw new IllegalArgumentException(localStrings.getLocalString(
								       "enterprise.deployment.exceptionwebapphasnojmsdestrefbyname",
								       "This web app [{0}] has no resource environment reference by the name of [{1}]", new Object[] {getName(), name}));
    
public java.util.SetgetJmsDestinationReferenceDescriptors()
Return the set of JMS destination references this ejb declares.

	if (this.jmsDestReferences == null) {
	    this.jmsDestReferences = new OrderedSet();
	}
	return this.jmsDestReferences = new OrderedSet(this.jmsDestReferences);
    
public JspConfigDescriptorgetJspConfigDescriptor()

	return jspConfigDescriptor;
    
public java.util.SetgetJspDescriptors()
Return my Set of jsps.

	Set jspDescriptors = new HashSet();
	for (Iterator itr = this.getWebComponentDescriptorsSet().iterator(); itr.hasNext();) {
	    WebComponentDescriptor next = (WebComponentDescriptor) itr.next();
            if (!next.isServlet()) {
		jspDescriptors.add(next);
	    }
	}
	return jspDescriptors;
    
public LocaleEncodingMappingListDescriptorgetLocaleEncodingMappingListDescriptor()

	return localeEncodingMappingDesc;
    
public java.util.EnumerationgetLocalizedContentDescriptors()
Unused.

	return (new Vector()).elements();
    
public com.sun.enterprise.deployment.web.LoginConfigurationgetLoginConfiguration()
Return the information about how I should log in.

	return this.loginConfiguration;
    
public MessageDestinationReferenceDescriptorgetMessageDestinationReferenceByName(java.lang.String name)
Looks up an message destination reference with the given name. Throws an IllegalArgumentException if it is not found.

	for (Iterator itr = 
                 this.getMessageDestinationReferenceDescriptors().iterator(); 
             itr.hasNext();) {
	    MessageDestinationReferenceDescriptor mdr = 
                (MessageDestinationReferenceDescriptor) itr.next();
	    if (mdr.getName().equals(name)) {
		return mdr;
	    }
	}
        throw new IllegalArgumentException(localStrings.getLocalString(
                "exceptionwebapphasnomsgdestrefbyname",
                "This web app [{0}] has no message destination reference by the name of [{1}]",
                new Object[] {getName(), name}));
    
public java.util.SetgetMessageDestinationReferenceDescriptors()

        if( this.messageDestReferences == null ) {
            this.messageDestReferences = new OrderedSet();
        }
        return this.messageDestReferences = 
            new OrderedSet(this.messageDestReferences);
    
public java.util.EnumerationgetMimeMappings()
Returns an enumeration of my mime mappings.

	return (new Vector(this.getMimeMappingsSet())).elements();
    
private java.util.SetgetMimeMappingsSet()

	if (this.mimeMappings == null) {
	    this.mimeMappings = new HashSet();
	}
	return this.mimeMappings;
    
public javax.enterprise.deploy.shared.ModuleTypegetModuleType()

return
the module type for this bundle descriptor

        return ModuleType.WAR;
    
public java.util.CollectiongetNamedDescriptors()
Return the set of named descriptors that I have.

	return super.getNamedDescriptorsFrom(this);
    
public java.util.VectorgetNamedReferencePairs()
Return the saet of NamedReferencePairs that I have.

	return super.getNamedReferencePairsFrom(this);
    
public LifecycleCallbackDescriptorgetPostConstructDescriptorByClass(java.lang.String className)

        return getPostConstructDescriptorByClass(className, this);
    
public java.util.SetgetPostConstructDescriptors()

        return postConstructDescs;
    
public LifecycleCallbackDescriptorgetPreDestroyDescriptorByClass(java.lang.String className)

        return getPreDestroyDescriptorByClass(className, this);
    
public java.util.SetgetPreDestroyDescriptors()

        return preDestroyDescs;
    
public ResourceReferenceDescriptorgetResourceReferenceByName(java.lang.String name)
Returns a reource reference with the matching name or throw.

	for (Iterator itr = this.getResourceReferenceDescriptors().iterator(); itr.hasNext();) {
	    ResourceReferenceDescriptor next = (ResourceReferenceDescriptor) itr.next();
	    if (next.getName().equals(name)) {
		return next;   
	    }
	}
	throw new IllegalArgumentException(localStrings.getLocalString(
							      "enterprise.deployment.exceptionwebapphasnoresourcerefbyname",
							      "This web app [{0}] has no resource reference by the name of [{1}]", new Object[] {getName(), name}));
    
public java.util.SetgetResourceReferenceDescriptors()
RReturns my Set of references to resources.

	if (this.resourceReferences == null) {
	    this.resourceReferences = new OrderedSet();
	}
	return this.resourceReferences = new OrderedSet(this.resourceReferences);
    
public java.util.EnumerationgetResourceReferences()
Return an enumeration of references to resources that I have.

	return (new Vector(this.getResourceReferenceDescriptors())).elements();
    
public java.util.EnumerationgetSecurityConstraints()
My list of security constraints.

	return (new Vector(this.getSecurityConstraintsSet())).elements();
    
public java.util.CollectiongetSecurityConstraintsForUrlPattern(java.lang.String urlPattern)

        Collection constraints = new HashSet();
        for(Iterator i = getSecurityConstraintsSet().iterator(); i.hasNext();) {
            SecurityConstraint next = (SecurityConstraint) i.next();
            boolean include = false;
            for(Enumeration wrc = next.getWebResourceCollections(); 
                wrc.hasMoreElements();) {
                WebResourceCollection nextCol = (WebResourceCollection) 
                    wrc.nextElement();
                for(Enumeration up = nextCol.getUrlPatterns();
                    up.hasMoreElements();) {
                    String nextPattern = (String) up.nextElement();
                    if((urlPattern != null) && urlPattern.equals(nextPattern)) {
                        include = true;
                        break;
                    }
                }
                if( include ) { break; }
            }
            if( include ) { constraints.add(next); }
        }
        return constraints;
    
private java.util.SetgetSecurityConstraintsSet()

	if (this.securityConstraints == null) {
	    this.securityConstraints = new HashSet();
	}
	return this.securityConstraints;
    
public com.sun.enterprise.deployment.web.SecurityRoleReferencegetSecurityRoleReferenceByName(java.lang.String compName, java.lang.String roleName)
Return all the references by a given component (by name) to the given rolename.

	    for(Enumeration e = this.getWebComponentDescriptors(); e.hasMoreElements();){
		WebComponentDescriptor comp = (WebComponentDescriptor) e.nextElement();
		if(!comp.getCanonicalName().equals(compName))
		    continue;

		SecurityRoleReference r = comp.getSecurityRoleReferenceByName(roleName);
		if(r != null)
		    return r;
	    }

	    return null;
    
public java.util.EnumerationgetSecurityRoles()
Returns an Enumeration of my SecurityRole objects.

	Vector securityRoles = new Vector();
	for (Iterator itr = super.getRoles().iterator(); itr.hasNext();) {
	    Role r = (Role) itr.next();
	    SecurityRoleDescriptor srd = new SecurityRoleDescriptor(r);
	    securityRoles.add(srd);
	}
	return securityRoles.elements();
    
public ServiceReferenceDescriptorgetServiceReferenceByName(java.lang.String name)
Looks up an service reference with the given name. Throws an IllegalArgumentException if it is not found.

	for (Iterator itr = this.getServiceReferenceDescriptors().iterator(); 
             itr.hasNext();) {
	    ServiceReferenceDescriptor srd = (ServiceReferenceDescriptor) 
                itr.next();
	    if (srd.getName().equals(name)) {
		return srd;
	    }
	}
        throw new IllegalArgumentException(localStrings.getLocalString(
            "enterprise.deployment.exceptionwebapphasnoservicerefbyname",
            "This web app [{0}] has no service reference by the name of [{1}]",
            new Object[] {getName(), name}));
    
public java.util.SetgetServiceReferenceDescriptors()

        if( this.serviceReferences == null ) {
            this.serviceReferences = new OrderedSet();
        }
        return this.serviceReferences = new OrderedSet(this.serviceReferences);
    
public java.util.SetgetServletDescriptors()

	Set servletDescriptors = new HashSet();
	for (Iterator itr = this.getWebComponentDescriptorsSet().iterator(); itr.hasNext();) {
	    WebComponentDescriptor next = (WebComponentDescriptor) itr.next();
            if (next.isServlet()) {
		servletDescriptors.add(next);
	    }
	}
	return servletDescriptors;
    
public java.util.VectorgetServletFilterDescriptors()
Return a Vector of servlet filters that I have.

 
	return (Vector)this.getServletFilters().clone(); 
    
public java.util.VectorgetServletFilterMappingDescriptors()
Return a Vector of servlet filter mappings that I have.

 
	return (Vector)this.getServletFilterMappings().clone(); 
    
public java.util.VectorgetServletFilterMappings()
Return a Vector of servlet filters that I have.

 
	if (this.servletFilterMappings == null) {
	    this.servletFilterMappings = new Vector();
	}
	return this.servletFilterMappings;
    
public java.util.VectorgetServletFilters()
Return a Vector of servlet filters that I have.

 
	if (this.servletFilters == null) {
	    this.servletFilters = new Vector();
	}
	return this.servletFilters;
    
public intgetSessionTimeout()
Return the value in seconds of when requests should time out.

	return this.sessionTimeout;
    
public com.sun.enterprise.deployment.runtime.web.SunWebAppgetSunDescriptor()
This returns the extra web sun specific info not in the RI DID.

return
object representation of web deployment descriptor

	if (sunWebApp==null) {
	    sunWebApp = new SunWebApp();
	}
        return sunWebApp;
    
public WebComponentDescriptorgetWebComponentByCanonicalName(java.lang.String name)
Search for a web component that I have by name.

	for (Iterator itr = this.getWebComponentDescriptorsSet().iterator(); itr.hasNext();) {
	    WebComponentDescriptor next = (WebComponentDescriptor) itr.next();
	    if (next.getCanonicalName().equals(name)) {
		return (WebComponentDescriptor) next;
	    }
	}
	return null;
    
public WebComponentDescriptor[]getWebComponentByImplName(java.lang.String name)

return
a set of web component descriptor of given impl name.

        ArrayList<WebComponentDescriptor> webCompList =
                new ArrayList<WebComponentDescriptor>();
	for (Object webCompObj : this.getWebDescriptors()) {
            WebComponentDescriptor webComp = (WebComponentDescriptor)webCompObj;
            if (webComp.getWebComponentImplementation().equals(name)) {
                webCompList.add(webComp);
            }
        }
        return webCompList.toArray(new WebComponentDescriptor[webCompList.size()]);
    
public WebComponentDescriptorgetWebComponentByName(java.lang.String name)
Search for a web component that I have by name.

	for (Iterator itr = this.getWebComponentDescriptorsSet().iterator(); itr.hasNext();) {
	    Descriptor next = (Descriptor) itr.next();
	    if (next.getName().equals(name)) {
		return (WebComponentDescriptor) next;
	    }
	}
	return null;
    
public java.util.EnumerationgetWebComponentDescriptors()
Return an Enumeration of Web COmponent Descriptors (JSP or JavaServlets) in me.

	return (new Vector(this.getWebComponentDescriptorsSet())).elements();
    
public java.util.SetgetWebComponentDescriptorsSet()

	if (this.webComponentDescriptors == null) {
	    this.webComponentDescriptors = new OrderedSet();
	}
	return this.webComponentDescriptors;
    
public java.util.SetgetWebDescriptors()
Return the Set of Web COmponent Descriptors (JSP or JavaServlets) in me.

	if (this.webComponentDescriptors == null) {
	    this.webComponentDescriptors = new OrderedSet();
	}
	return this.webComponentDescriptors;
    
public java.util.EnumerationgetWelcomeFiles()
Return an enumeration of the welcome files I have..

	return (new Vector(this.getWelcomeFilesSet())).elements();
    
public java.util.SetgetWelcomeFilesSet()

	if (this.welcomeFiles == null) {
	    this.welcomeFiles = new OrderedSet();
	}
	return welcomeFiles;
    
public booleanhasServiceReferenceDescriptors()
WEB SERVICES REF APIS

	if (serviceReferences==null) 
	    return false;
	return serviceReferences.size()!=0;
    
public booleanhasWebServiceClients()

return
true if this bundle descriptor defines web service clients

        return !getServiceReferenceDescriptors().isEmpty();
    
public booleanisDistributable()
Return true if this web app [{0}] can be distributed across different processes.

	return isDistributable;
    
public voidmoveAppListenerDescriptor(com.sun.enterprise.deployment.web.AppListenerDescriptor ref, int relPos)

	this.moveVectorItem(this.getAppListeners(), ref, relPos);
	this.changed();
    
public voidmoveServletFilterMapping(com.sun.enterprise.deployment.web.ServletFilterMapping ref, int relPos)
Moves the given servlet filter mapping to a new relative location in the list

	this.moveVectorItem(this.getServletFilterMappings(), ref, relPos);
	this.changed();
    
protected voidmoveVectorItem(java.util.Vector list, java.lang.Object ref, int rpos)
Moves the given object to a new relative location in the specified list


	/* get current position of ref */
	// 'indexOf' is not used because it is base on 'equals()' which may
	// not be unique.
	int size = list.size(), old_pos = size - 1;
	for (;old_pos >= 0; old_pos--) {
	    if (ref == list.elementAt(old_pos)) {
		break;
	    }
	}
	if (old_pos < 0) {
	    return; // not found
	}

	/* limit up/down movement */
	int new_pos = old_pos + rpos;
	if (new_pos < 0) {
	    new_pos = 0; // limit movement
	} else
	if (new_pos >= size) {
	    new_pos = size - 1; // limit movement
	}

	/* is it really moving? */
	if (new_pos == old_pos) {
	    return; // it's not moving
	}	
	
	/* move it */
	list.removeElementAt(old_pos);
	list.insertElementAt(ref, new_pos);
	this.changed();

    
public voidnotification(com.sun.enterprise.util.NotificationEvent ne)

	// currently, notifications come only from the WebServiceBundleDescriptor
	this.changed();
    
public voidprint(java.lang.StringBuffer toStringBuffer)
Return a formatted version as a String.

	toStringBuffer.append("\nWeb Bundle descriptor");
	toStringBuffer.append("\n");
        super.print(toStringBuffer);
        toStringBuffer.append( "\n context root ").append(getContextRoot());
	toStringBuffer.append( "\n sessionTimeout ").append(sessionTimeout);
	toStringBuffer.append( "\n mimeMappings ").append(mimeMappings);
	toStringBuffer.append( "\n welcomeFiles ").append(welcomeFiles);
	toStringBuffer.append( "\n errorPageDescriptors ").append(errorPageDescriptors);
	toStringBuffer.append( "\n appListenerDescriptors ").append(appListenerDescriptors);
	toStringBuffer.append( "\n contextParameters ").append(contextParameters);
	toStringBuffer.append( "\n ejbReferences ");
        if(ejbReferences != null)
            printDescriptorSet(ejbReferences,toStringBuffer);
        toStringBuffer.append( "\n jmsDestReferences ");
        if(jmsDestReferences != null)
            printDescriptorSet(jmsDestReferences,toStringBuffer);
        toStringBuffer.append( "\n messageDestReferences ");
        if(messageDestReferences != null)
            printDescriptorSet(messageDestReferences,toStringBuffer);
	toStringBuffer.append( "\n resourceReferences ");
        if(resourceReferences != null)
            printDescriptorSet(resourceReferences,toStringBuffer);
	toStringBuffer.append( "\n serviceReferences ");
        if(serviceReferences != null)
            printDescriptorSet(serviceReferences,toStringBuffer);
	toStringBuffer.append( "\n isDistributable ").append(isDistributable);
	toStringBuffer.append( "\n securityRoles ").append(securityRoles);
	toStringBuffer.append( "\n securityConstraints ").append(securityConstraints);
	toStringBuffer.append( "\n contextRoot ").append(contextRoot);
	toStringBuffer.append( "\n loginConfiguration ").append(this.loginConfiguration);
	toStringBuffer.append( "\n webComponentDescriptors ");
        if(webComponentDescriptors != null)
            printDescriptorSet(webComponentDescriptors,toStringBuffer);
	toStringBuffer.append( "\n environmentEntries ");
        if(environmentEntries != null)
            printDescriptorSet(environmentEntries,toStringBuffer);       
	if (sunWebApp!=null) {
	    toStringBuffer.append( "\n ========== Runtime Descriptors =========");
	    toStringBuffer.append( "\n").append(sunWebApp.toString());
	}
    
private voidprintDescriptorSet(java.util.Set descSet, java.lang.StringBuffer sbuf)

        if (descSet==null) 
            return;
        for(Iterator itr = descSet.iterator(); itr.hasNext();){
            Object obj = itr.next();
            if(obj instanceof Descriptor)
                ((Descriptor)obj).print(sbuf);
            else
                sbuf.append(obj);
        }
    
public voidremoveAppListenerDescriptor(com.sun.enterprise.deployment.web.AppListenerDescriptor ref)

	this.removeVectorItem(this.getAppListeners(), ref);
	//this.getAppListeners().removeElement(ref);
	this.changed();
    
public voidremoveContextParameter(com.sun.enterprise.deployment.web.ContextParameter contextParameter)
Removes the given context parameter from my list.

	this.getContextParametersSet().remove(contextParameter);
	this.changed();
    
public voidremoveEjbReferenceDescriptor(EjbReferenceDescriptor ejbReferenceDescriptor)
Removes a reference to an ejb.

	this.removeEjbReferenceDescriptor((EjbReference) ejbReferenceDescriptor);
    
public voidremoveEjbReferenceDescriptor(com.sun.enterprise.deployment.types.EjbReference ejbReferenceDescriptor)

    
	this.getEjbReferenceDescriptors().remove(ejbReferenceDescriptor);
        ejbReferenceDescriptor.setReferringBundleDescriptor(null);
	this.changed();        
    
public voidremoveEnvironmentEntry(com.sun.enterprise.deployment.web.EnvironmentEntry environmentEntry)
Removes this given environment property from my list.

	this.getEnvironmentEntrySet().remove(environmentEntry);
	this.changed();
    
public voidremoveEnvironmentProperty(EnvironmentProperty environmentProperty)
Removes this given environment property from my list.

	this.getEnvironmentEntrySet().remove(environmentProperty);
	this.changed();
    
public voidremoveErrorPageDescriptor(com.sun.enterprise.deployment.web.ErrorPageDescriptor errorPageDescriptor)
Removes the given error page from my list.

	this.getErrorPageDescriptorsSet().remove(errorPageDescriptor);
	this.changed();
    
public voidremoveJmsDestinationReferenceDescriptor(JmsDestinationReferenceDescriptor jmsDestReference)

	this.getJmsDestinationReferenceDescriptors().remove(jmsDestReference);
	this.changed();
    
public voidremoveMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor msgDestRef)

        this.getMessageDestinationReferenceDescriptors().remove(msgDestRef);
        this.changed();
    
public voidremoveMimeMapping(com.sun.enterprise.deployment.web.MimeMapping mimeMapping)
Removes the given mime mapping from my list.

	this.getMimeMappingsSet().remove(mimeMapping);
	this.changed();
    
public voidremoveResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)
removes a reference to a resource.

	this.getResourceReferenceDescriptors().remove(resourceReference);
	this.changed();
    
public voidremoveSecurityConstraint(com.sun.enterprise.deployment.web.SecurityConstraint securityConstraint)
Remove the given security constraint.

	this.getSecurityConstraintsSet().remove(securityConstraint);
	this.changed();
    
public voidremoveServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)

        this.getServiceReferenceDescriptors().remove(serviceRef);
        this.changed();
    
public voidremoveServletFilter(com.sun.enterprise.deployment.web.ServletFilter ref)
Removes the given servlet filter from this web component.

	this.removeVectorItem(this.getServletFilters(), ref);
	//this.getServletFilters().removeElement(ref); ** is based on 'equals()'
	this.changed();
    
public voidremoveServletFilterMapping(com.sun.enterprise.deployment.web.ServletFilterMapping ref)
Removes the given servlet filter mapping from this web component.

	this.removeVectorItem(this.getServletFilterMappings(), ref);
	//this.getServletFilterMappings().removeElement(ref);
	this.changed();
    
protected booleanremoveVectorItem(java.util.Vector list, java.lang.Object ref)
remove a specific object from the given list (does not rely on 'equals')

	for (Iterator i = list.iterator(); i.hasNext();) {
	    if (ref == i.next()) {
		i.remove();
		return true;
	    }
	}
	return false;
    
public voidremoveWebComponentDescriptor(WebComponentDescriptor webComponentDescriptor)
Remove the given web component from me.

	((WebComponentDescriptor) webComponentDescriptor).setWebBundleDescriptor(null);
	this.getWebComponentDescriptorsSet().remove(webComponentDescriptor);
	this.changed();
    
public voidremoveWelcomeFile(java.lang.String fileUri)
Removes a welcome file from my list.

	this.getWelcomeFilesSet().remove(fileUri);
	this.changed();
    
public voidsetAppListeners(java.util.Collection c)

 
	this.getAppListeners().clear();
	this.getAppListeners().addAll(c);
	this.changed();
    
public voidsetContextRoot(java.lang.String contextRoot)
Set the name of my context root.

        if (getModuleDescriptor()!=null) {
            getModuleDescriptor().setContextRoot(contextRoot);
        }
	this.contextRoot = contextRoot;
	this.changed();
    
public voidsetDistributable(boolean isDistributable)
Sets whether this web app [{0}] can be distributed across different processes.

	this.isDistributable = isDistributable;
	this.changed();
    
public voidsetJspConfigDescriptor(JspConfigDescriptor jspC)

	if (jspConfigDescriptor != null) {
            jspConfigDescriptor.removeNotificationListener(this);
	}
	jspConfigDescriptor = jspC;
	if (jspC != null) {
            jspC.addNotificationListener(this);
	}
    
public voidsetLocaleEncodingMappingListDescriptor(LocaleEncodingMappingListDescriptor lemDesc)

	localeEncodingMappingDesc = lemDesc;
    
public voidsetLoginConfiguration(com.sun.enterprise.deployment.web.LoginConfiguration loginConfiguration)
Specifies the information about how I should log in.

	this.loginConfiguration = loginConfiguration;
	this.changed();
    
public voidsetLoginConfiguration(LoginConfigurationImpl loginConfiguration)

        setLoginConfiguration((LoginConfiguration) loginConfiguration);
    
public voidsetMimeMappings(java.util.Set mimeMappings)
Sets the Set of Mime Mappings for this web app [{0}]lication.

	this.mimeMappings = mimeMappings;
	this.changed();
    
public voidsetSessionTimeout(int sessionTimeout)
Sets thew value in seconds after sessions should timeout.

	this.sessionTimeout = sessionTimeout;
	this.changed();
    
public voidsetSunDescriptor(com.sun.enterprise.deployment.runtime.web.SunWebApp webApp)
This sets the extra web sun specific info not in the RI DID.

param
webApp SunWebApp object representation of web deployment descriptor

        this.sunWebApp = webApp;
    
public voidsetWelcomeFiles(java.util.Set welcomeFiles)
Sets the collection of my welcome files.

	this.welcomeFiles = welcomeFiles;
	this.changed();
    
public voidvisit(com.sun.enterprise.deployment.util.DescriptorVisitor aVisitor)
visitor API implementation

        if (aVisitor instanceof WebBundleVisitor) {
            visit((WebBundleVisitor) aVisitor);
        } else {
            super.visit(aVisitor);
        }
    
public voidvisit(com.sun.enterprise.deployment.util.WebBundleVisitor aVisitor)
visitor API implementation

        super.visit(aVisitor);
        aVisitor.accept(this);

        // Visit all injectables first.  In some cases, basic type information
        // has to be derived from target inject method or inject field.
        for(InjectionCapable injectable : getInjectableResources(this)) {
            aVisitor.accept(injectable);
        }

        for (Iterator i=getWebComponentDescriptorsSet().iterator();i.hasNext();) {
            WebComponentDescriptor aWebComp = (WebComponentDescriptor) i.next();
            aVisitor.accept(aWebComp);
        }
        for (Iterator itr=getWebServices().getWebServices().iterator();
             itr.hasNext(); ) {
            WebService aWebService = (WebService) itr.next();
            aVisitor.accept(aWebService);
        }

        for (Iterator itr = getEjbReferenceDescriptors().iterator();itr.hasNext();) {
            EjbReference aRef = (EjbReference) itr.next();
            aVisitor.accept(aRef);
        }
        for (Iterator itr=getResourceReferenceDescriptors().iterator();
             itr.hasNext();) {
            ResourceReferenceDescriptor next = 
                (ResourceReferenceDescriptor) itr.next();
            aVisitor.accept(next);
        }
        for (Iterator itr=getJmsDestinationReferenceDescriptors().iterator();
             itr.hasNext();) {
            JmsDestinationReferenceDescriptor next = 
                (JmsDestinationReferenceDescriptor) itr.next();
            aVisitor.accept(next);
        }
        for (Iterator itr=getMessageDestinationReferenceDescriptors().iterator();
             itr.hasNext();) {
            MessageDestinationReferencer next = 
                (MessageDestinationReferencer) itr.next();
            aVisitor.accept(next);
        }
        for (Iterator itr = getMessageDestinations().iterator();
                itr.hasNext();) {
            MessageDestinationDescriptor msgDestDescriptor =
                (MessageDestinationDescriptor)itr.next();
            aVisitor.accept(msgDestDescriptor);
        }
        for (Iterator itr=getServiceReferenceDescriptors().iterator();
             itr.hasNext();) {
            aVisitor.accept((ServiceReferenceDescriptor) itr.next());
        }