amyroh 02/05/06 22:52:40 Modified: catalina/src/share/org/apache/catalina/mbeans MBeanFactory.java Log: Check for "/" path and convert to root context. Revision Changes Path 1.33 +15 -9 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java Index: MBeanFactory.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- MBeanFactory.java 6 May 2002 23:08:31 -0000 1.32 +++ MBeanFactory.java 7 May 2002 05:52:40 -0000 1.33 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v 1.32 2002/05/06 23:08:31 craigmcc Exp $ - * $Revision: 1.32 $ - * $Date: 2002/05/06 23:08:31 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v 1.33 2002/05/07 05:52:40 amyroh Exp $ + * $Revision: 1.33 $ + * $Date: 2002/05/07 05:52:40 $ * * ==================================================================== * @@ -117,7 +117,7 @@ * <code>org.apache.catalina.core.StandardServer</code> component.</p> * * @author Amy Roh - * @version $Revision: 1.32 $ $Date: 2002/05/06 23:08:31 $ + * @version $Revision: 1.33 $ $Date: 2002/05/07 05:52:40 $ */ public class MBeanFactory extends BaseModelMBean { @@ -925,7 +925,8 @@ Service service = server.findService(pname.getKeyProperty("service")); Engine engine = (Engine) service.getContainer(); Host host = (Host) engine.findChild(pname.getKeyProperty("host")); - Context context = (Context) host.findChild(pname.getKeyProperty("path")); + String pathStr = getPathStr(pname.getKeyProperty("path")); + Context context = (Context) host.findChild(pathStr); context.setManager(manager); // Return the corresponding MBean name @@ -1106,7 +1107,8 @@ Service service = server.findService(pname.getKeyProperty("service")); Engine engine = (Engine) service.getContainer(); Host host = (Host) engine.findChild(pname.getKeyProperty("host")); - Context context = (Context) host.findChild(pname.getKeyProperty("path")); + String pathStr = getPathStr(pname.getKeyProperty("path")); + Context context = (Context) host.findChild(pathStr); context.setLoader(loader); // Return the corresponding MBean name @@ -1179,7 +1181,7 @@ ObjectName oname = new ObjectName(name); String serviceName = oname.getKeyProperty("service"); String hostName = oname.getKeyProperty("host"); - String contextName = oname.getKeyProperty("path"); + String contextName = getPathStr(oname.getKeyProperty("path")); Server server = ServerFactory.getServer(); Service service = server.findService(serviceName); Engine engine = (Engine) service.getContainer(); @@ -1229,6 +1231,7 @@ ObjectName oname = new ObjectName(name); String serviceName = oname.getKeyProperty("service"); String hostName = oname.getKeyProperty("host"); + String path = oname.getKeyProperty("path"); Server server = ServerFactory.getServer(); Service service = server.findService(serviceName); @@ -1258,6 +1261,7 @@ } } else { // logger's container is Context StandardHost host = (StandardHost) engine.findChild(hostName); + path = getPathStr(path); StandardContext context = (StandardContext) host.findChild(path); Logger logger = context.getLogger(); Container container = logger.getContainer(); @@ -1290,7 +1294,7 @@ ObjectName oname = new ObjectName(name); String serviceName = oname.getKeyProperty("service"); String hostName = oname.getKeyProperty("host"); - String contextName = oname.getKeyProperty("path"); + String contextName = getPathStr(oname.getKeyProperty("path")); Server server = ServerFactory.getServer(); Service service = server.findService(serviceName); Engine engine = (Engine) service.getContainer(); @@ -1316,7 +1320,7 @@ ObjectName oname = new ObjectName(name); String serviceName = oname.getKeyProperty("service"); String hostName = oname.getKeyProperty("host"); - String contextName = oname.getKeyProperty("path"); + String contextName = getPathStr(oname.getKeyProperty("path")); Server server = ServerFactory.getServer(); Service service = server.findService(serviceName); Engine engine = (Engine) service.getContainer(); @@ -1371,6 +1375,7 @@ } } else { // realm's container is Context StandardHost host = (StandardHost) engine.findChild(hostName); + path = getPathStr(path); StandardContext context = (StandardContext) host.findChild(path); Realm realm = context.getRealm(); Container container = realm.getContainer(); @@ -1464,6 +1469,7 @@ } } 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++) {
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>