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);
}
Aggregations