Search in sources :

Example 6 with ApplicationParameter

use of org.apache.tomcat.util.descriptor.web.ApplicationParameter in project tomcat by apache.

the class StandardContext method removeApplicationParameter.

/**
 * Remove the application parameter with the specified name from
 * the set for this application.
 *
 * @param name Name of the application parameter to remove
 */
@Override
public void removeApplicationParameter(String name) {
    synchronized (applicationParametersLock) {
        // Make sure this parameter is currently present
        int n = -1;
        for (int i = 0; i < applicationParameters.length; i++) {
            if (name.equals(applicationParameters[i].getName())) {
                n = i;
                break;
            }
        }
        if (n < 0) {
            return;
        }
        // Remove the specified parameter
        int j = 0;
        ApplicationParameter[] results = new ApplicationParameter[applicationParameters.length - 1];
        for (int i = 0; i < applicationParameters.length; i++) {
            if (i != n) {
                results[j++] = applicationParameters[i];
            }
        }
        applicationParameters = results;
    }
    // Inform interested listeners
    fireContainerEvent("removeApplicationParameter", name);
}
Also used : ApplicationParameter(org.apache.tomcat.util.descriptor.web.ApplicationParameter) SecurityConstraint(org.apache.tomcat.util.descriptor.web.SecurityConstraint)

Aggregations

ApplicationParameter (org.apache.tomcat.util.descriptor.web.ApplicationParameter)6 StandardContext (org.apache.catalina.core.StandardContext)2 SecurityConstraint (org.apache.tomcat.util.descriptor.web.SecurityConstraint)2 ServletContext (jakarta.servlet.ServletContext)1 File (java.io.File)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 JarEntry (java.util.jar.JarEntry)1 JarFile (java.util.jar.JarFile)1 Context (org.apache.catalina.Context)1 Host (org.apache.catalina.Host)1 LifecycleListener (org.apache.catalina.LifecycleListener)1 Loader (org.apache.catalina.Loader)1 Manager (org.apache.catalina.Manager)1 Realm (org.apache.catalina.Realm)1