Package javax.management

Examples of javax.management.RuntimeMBeanException


               throw (InstanceNotFoundException) t;
            if (t instanceof MBeanRegistrationException)
               throw (MBeanRegistrationException) t;
         }
         if (result instanceof RuntimeException)
            throw new RuntimeMBeanException((RuntimeException) result);
         if (result instanceof Error)
            throw new RuntimeErrorException((Error) result);

         // for some other reason, unregistration failed
         throw new MBeanRegistrationException(new InvocationTargetException(t), "Cannot unregister MBean");
View Full Code Here


      else if (t instanceof InvocationTargetException)
      {
         Throwable root = ((InvocationTargetException) t).getTargetException();

         if (root instanceof RuntimeException)
            throw new RuntimeMBeanException((RuntimeException) root, className + " constructor has thrown an exception: " + root.toString());
         else if (root instanceof Error)
            throw new RuntimeErrorException((Error) root, className + " constructor has thrown an error: " + root.toString());
         else if (root instanceof Exception)
            throw new MBeanException((Exception) root, className + " constructor has thrown an exception: " + root.toString());

         throw new Error("Something went wrong with handling the exception from " + className + " default constructor.");
      }

      else if (t instanceof ExceptionInInitializerError)
      {
         Throwable root = ((ExceptionInInitializerError) t).getException();

         // the root cause can be only a runtime exception
         if (root instanceof RuntimeException)
            throw new RuntimeMBeanException((RuntimeException) root, "Exception in class " + className + " static initializer: " + root.toString());
         else
         // shouldn't get here
            throw new Error("ERROR: it turns out the root cause is not always a runtime exception!");
      }
View Full Code Here

               throw (MBeanRegistrationException) t;
            if (t instanceof NotCompliantMBeanException)
               throw (NotCompliantMBeanException) t;
         }
         if (result instanceof RuntimeException)
            throw new RuntimeMBeanException((RuntimeException) result);
         if (result instanceof Error)
            throw new RuntimeErrorException((Error) result);

         // for some other reason, registration failed
         throw new MBeanRegistrationException(new InvocationTargetException(t), "Cannot register MBean");
View Full Code Here

      catch (InvocationTargetException e)
      {
         Throwable t = e.getTargetException();
         if (t instanceof RuntimeException)
         {
            throw new RuntimeMBeanException((RuntimeException) t, "RuntimeException in MBean when getting attribute '" + attribute + "'");
         }
         else if (t instanceof Exception)
         {
            throw new MBeanException((Exception) t, "Exception in MBean when getting attribute '" + attribute + "'");
         }
View Full Code Here

      catch (InvocationTargetException e)
      {
         Throwable t = e.getTargetException();
         if (t instanceof RuntimeException)
         {
            throw new RuntimeMBeanException((RuntimeException) t, "RuntimeException in MBean when setting attribute '" + attribute.getName() + "'");
         }
         else if (t instanceof Exception)
         {
            throw new MBeanException((Exception) t, "Exception in MBean when setting attribute '" + attribute.getName() + "'");
         }
View Full Code Here

      catch (InvocationTargetException e)
      {
         Throwable t = e.getTargetException();
         if (t instanceof RuntimeException)
         {
            throw new RuntimeMBeanException((RuntimeException) t, "RuntimeException in MBean operation '" + opKeyString(actionName, signature) + "'");
         }
         else if (t instanceof Exception)
         {
            throw new MBeanException((Exception) t, "Exception in MBean operation '" + opKeyString(actionName, signature) + "'");
         }
View Full Code Here

      {
         t = ((InvocationTargetException) t).getTargetException();
         if (t instanceof RuntimeOperationsException)
            throw (RuntimeOperationsException) t;
         else if (t instanceof RuntimeException)
            throw new RuntimeMBeanException((RuntimeException) t);
         else if (t instanceof Error)
            throw new RuntimeErrorException((Error) t);
         else if (t instanceof Exception)
            throw new MBeanException((Exception) t);
         else
View Full Code Here

      {
         ((NotificationBroadcaster) resource).addNotificationListener(listener, filter, handback);
      }
      else
      {
         throw new RuntimeMBeanException(new IllegalArgumentException("Target XXX is not a notification broadcaster"

            // FIXME: add the XXX object name, store from registration
         ));
      }
   }
View Full Code Here

      {
         ((NotificationBroadcaster) resource).removeNotificationListener(listener);
      }
      else
      {
         throw new RuntimeMBeanException(new IllegalArgumentException("Target XXX is not a notification broadcaster"

            // FIXME: add the XXX object name, store from registration
         ));
      }
   }
View Full Code Here

         //w/o this .. you'll get a resource failure below
         removeNotificationListener(listener);
      }
      else
      {
         throw new RuntimeMBeanException(new IllegalArgumentException("Target XXX is not a notification emitter"

            // FIXME: add the XXX object name, store from registration
         ));
      }
   }
View Full Code Here

TOP

Related Classes of javax.management.RuntimeMBeanException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.