"Cannot create mbean for non-contained valve " +
valve);
}
if (container instanceof Engine) {
Service service = ((Engine)container).getService();
name = new ObjectName(domain + ":type=Valve,sequence=" +
valve.hashCode() + ",service=" +
service.getName());
} else if (container instanceof Host) {
Service service = ((Engine)container.getParent()).getService();
name = new ObjectName(domain + ":type=Valve,sequence=" +
valve.hashCode() + ",host=" +
container.getName() + ",service=" +
service.getName() );
} else if (container instanceof Context) {
String path = ((Context)container).getPath();
if (path.length() < 1) {
path = "/";
}
Host host = (Host) container.getParent();
Service service = ((Engine) host.getParent()).getService();
name = new ObjectName(domain + ":type=Valve,sequence=" +
valve.hashCode() + ",path=" +
path + ",host=" +
host.getName() + ",service=" +
service.getName());
}
return (name);
}