break;
}
}
}
} else if (path == null) { // if valve's container is Host
StandardHost host = (StandardHost) engine.findChild(hostName);
Valve [] valves = host.getValves();
for (int i = 0; i < valves.length; i++) {
Container container = ((ValveBase)valves[i]).getContainer();
if (container instanceof StandardHost) {
String hn = ((StandardHost)container).getName();
StandardEngine se =
(StandardEngine) ((StandardHost)container).getParent();
String sname = se.getService().getName();
Integer sequenceInt = new Integer(valves[i].hashCode());
if ((sname.equals(serviceName) && hn.equals(hostName)) &&
sequence.equals(sequenceInt.toString())){
host.removeValve(valves[i]);
break;
}
}
}
} else { // valve's container is Context
StandardHost host = (StandardHost) engine.findChild(hostName);
path = getPathStr(path);
StandardContext context = (StandardContext) host.findChild(path);
Valve [] valves = context.getValves();
for (int i = 0; i < valves.length; i++) {
Container container = ((ValveBase)valves[i]).getContainer();
if (container instanceof StandardContext) {
String pathName = ((StandardContext)container).getName();
StandardHost sh =
(StandardHost)((StandardContext)container).getParent();
String hn = sh.getName();;
StandardEngine se = (StandardEngine)sh.getParent();
String sname = se.getService().getName();
Integer sequenceInt = new Integer(valves[i].hashCode());
if (((sname.equals(serviceName) && hn.equals(hostName)) &&
pathName.equals(path)) &&
sequence.equals(sequenceInt.toString())){