Examples of RuntimeErrorException


Examples of javax.management.RuntimeErrorException

         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!");
      }

      else if (t instanceof IllegalArgumentException)
      {
         // if mismatch between constructor instance args and supplied args -- shouldn't happen
         throw new Error("Error in the server: mismatch between expected constructor arguments and supplied arguments.");
      }

      else if (t instanceof Error)
      {
         throw new RuntimeErrorException((Error)t, "instantiating " + className + " failed: " + t.toString());
      }
   }
View Full Code Here

Examples of javax.management.RuntimeErrorException

        
         // Invoked method threw an error. Wrapped as a JMX runtime error exception.
         else if (target instanceof Error)
         {
            throw new InvocationException(
                  new RuntimeErrorException((Error)target, target.toString())
            );
         }
        
         else throw new InvocationException(new Error("Unhandled exception: " + t.toString()));
      }
     
      // assume all other exceptions are reflection related
      else if (t instanceof Exception)
      {
         throw new InvocationException(
               new ReflectionException((Exception)t, t.toString())
         );
      }
     
      else if (t instanceof Error)
      {
         throw new InvocationException(
               new RuntimeErrorException((Error)t, t.toString())
         );
      }
     
      throw new InvocationException(new Error("Unhandled exception: " + t.toString()));
   }
View Full Code Here

Examples of javax.management.RuntimeErrorException

      catch (Throwable t)
      {        
         log.warn("preRegister() failed for " + regName + ": ", t);
        
         if (t instanceof Error)
            throw new RuntimeErrorException((Error)t);
         else
            throw new RuntimeException(t.toString());
      }
          
View Full Code Here

Examples of javax.management.RuntimeErrorException

                t = e;
            if (t instanceof RuntimeException)
                throw new RuntimeOperationsException
                    ((RuntimeException) t, "Exception invoking method " + name);
            else if (t instanceof Error)
                throw new RuntimeErrorException
                    ((Error) t, "Error invoking method " + name);
            else
                throw new MBeanException
                    (e, "Exception invoking method " + name);
        } catch (Exception e) {
View Full Code Here

Examples of javax.management.RuntimeErrorException

                t = e;
            if (t instanceof RuntimeException)
                throw new RuntimeOperationsException
                    ((RuntimeException) t, "Exception invoking method " + name);
            else if (t instanceof Error)
                throw new RuntimeErrorException
                    ((Error) t, "Error invoking method " + name);
            else
                throw new MBeanException
                    ((Exception)t, "Exception invoking method " + name);
        } catch (Exception e) {
View Full Code Here

Examples of javax.management.RuntimeErrorException

                t = e;
            if (t instanceof RuntimeException)
                throw new RuntimeOperationsException
                    ((RuntimeException) t, "Exception invoking method " + name);
            else if (t instanceof Error)
                throw new RuntimeErrorException
                    ((Error) t, "Error invoking method " + name);
            else
                throw new MBeanException
                    (e, "Exception invoking method " + name);
        } catch (Exception e) {
View Full Code Here

Examples of javax.management.RuntimeErrorException

      catch (InvocationTargetException x)
      {
         Throwable t = x.getTargetException();
         if (t instanceof RuntimeException) throw new RuntimeMBeanException((RuntimeException)t);
         if (t instanceof Exception) throw new MBeanException((Exception)t);
         throw new RuntimeErrorException((Error)t);
      }
      catch (Throwable t)
      {
         if (t instanceof RuntimeException) throw new RuntimeMBeanException((RuntimeException)t);
         if (t instanceof Exception) throw new MBeanException((Exception)t);
         throw new RuntimeErrorException((Error)t);
      }
   }
View Full Code Here

Examples of javax.management.RuntimeErrorException

      }
      catch (InvocationTargetException x)
      {
         Throwable t = x.getTargetException();
         if (t instanceof Error)
            throw new MBeanException(new RuntimeErrorException((Error)t));
         else
            throw new MBeanException((Exception)t);
      }
   }
View Full Code Here

Examples of javax.management.RuntimeErrorException

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

Examples of javax.management.RuntimeErrorException

      }
      catch (InvocationTargetException x)
      {
         Throwable t = x.getTargetException();
         if (t instanceof Error)
            throw new MBeanException(new RuntimeErrorException((Error)t));
         else
            throw new MBeanException((Exception)t);
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.