Revert r1174322 and apply the correct fix
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 22 Sep 2011 19:19:16 +0000 (19:19 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 22 Sep 2011 19:19:16 +0000 (19:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1174329 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/modeler/BaseModelMBean.java

index cb330a9..7d5145b 100644 (file)
@@ -43,6 +43,7 @@ import javax.management.ObjectName;
 import javax.management.ReflectionException;
 import javax.management.RuntimeErrorException;
 import javax.management.RuntimeOperationsException;
+import javax.management.modelmbean.InvalidTargetObjectTypeException;
 import javax.management.modelmbean.ModelMBeanNotificationBroadcaster;
 
 import org.apache.juli.logging.Log;
@@ -498,13 +499,16 @@ public class BaseModelMBean implements DynamicMBean, MBeanRegistration, ModelMBe
      *
      * @exception InstanceNotFoundException if the managed resource object
      *  cannot be found
+     * @exception InvalidTargetObjectTypeException if the managed resource
+     *  object is of the wrong type
      * @exception MBeanException if the initializer of the object throws
      *  an exception
      * @exception RuntimeOperationsException if the managed resource or the
      *  resource type is <code>null</code> or invalid
      */
-    public Object getManagedResource() throws InstanceNotFoundException,
-            MBeanException, RuntimeOperationsException {
+    public Object getManagedResource()
+        throws InstanceNotFoundException, InvalidTargetObjectTypeException,
+        MBeanException, RuntimeOperationsException {
 
         if (resource == null)
             throw new RuntimeOperationsException