You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by am...@apache.org on 2002/02/07 21:25:29 UTC
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans MBeanUtils.java
amyroh 02/02/07 12:25:29
Modified: catalina/src/share/org/apache/catalina/mbeans
MBeanUtils.java
Log:
Add DefaultContext mbean name exception and better log.
Revision Changes Path
1.20 +24 -24 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java
Index: MBeanUtils.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- MBeanUtils.java 7 Feb 2002 19:18:40 -0000 1.19
+++ MBeanUtils.java 7 Feb 2002 20:25:29 -0000 1.20
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v 1.19 2002/02/07 19:18:40 amyroh Exp $
- * $Revision: 1.19 $
- * $Date: 2002/02/07 19:18:40 $
+ * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v 1.20 2002/02/07 20:25:29 amyroh Exp $
+ * $Revision: 1.20 $
+ * $Date: 2002/02/07 20:25:29 $
*
* ====================================================================
*
@@ -108,7 +108,7 @@
*
* @author Craig R. McClanahan
* @author Amy Roh
- * @version $Revision: 1.19 $ $Date: 2002/02/07 19:18:40 $
+ * @version $Revision: 1.20 $ $Date: 2002/02/07 20:25:29 $
*/
public class MBeanUtils {
@@ -123,6 +123,8 @@
* is a class name, and the second element is the managed bean name.
*/
private static String exceptions[][] = {
+ { "org.apache.catalina.core.StandardDefaultContext",
+ "DefaultContext" },
{ "org.apache.catalina.connector.http10.HttpConnector",
"Http10Connector" },
{ "org.apache.catalina.connector.http.HttpConnector",
@@ -197,9 +199,7 @@
String mname = createManagedName(connector);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- // FIX ME
- // shoud we log "ManagedBean not found with ManagedName " + mname?
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -226,7 +226,7 @@
String mname = createManagedName(context);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -253,7 +253,7 @@
String mname = createManagedName(context);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -280,7 +280,7 @@
String mname = createManagedName(engine);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -307,7 +307,7 @@
String mname = createManagedName(group);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -334,7 +334,7 @@
String mname = createManagedName(host);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -361,7 +361,7 @@
String mname = createManagedName(loader);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -387,7 +387,7 @@
String mname = createManagedName(logger);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -414,7 +414,7 @@
String mname = createManagedName(manager);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -441,7 +441,7 @@
String mname = createManagedName(factory);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -468,7 +468,7 @@
String mname = createManagedName(realm);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -495,7 +495,7 @@
String mname = createManagedName(role);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -522,7 +522,7 @@
String mname = createManagedName(server);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -543,13 +543,13 @@
*
* @exception Exception if an MBean cannot be created or registered
*/
- public static ModelMBean createMBean(StandardService service)
+ public static ModelMBean createMBean(Service service)
throws Exception {
String mname = createManagedName(service);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -576,7 +576,7 @@
String mname = createManagedName(user);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -603,7 +603,7 @@
String mname = createManagedName(userDatabase);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
@@ -630,7 +630,7 @@
String mname = createManagedName(valve);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
- return null;
+ throw new Exception("ManagedBean is not found with "+mname);
}
String domain = managed.getDomain();
if (domain == null)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>