Package java.lang.reflect

Examples of java.lang.reflect.InvocationTargetException


    if (ret[0] != null) {
      if (ret[0] instanceof Exception) {
        throw (Exception)ret[0];
      }
      else {
        throw new InvocationTargetException(ret[0]);
      }
    }
    return (T)retSuccess[0];
  }
View Full Code Here


      {
         Throwable t = e.getException();
         if (t instanceof InvocationTargetException)
         {
            // This is a declared exception, just throw it
            InvocationTargetException ex = (InvocationTargetException) t;
            t = ex.getTargetException();
            throw (Exception) t;
         }
         else if (t instanceof UndeclaredThrowableException)
         {
            t = ((UndeclaredThrowableException) t).getUndeclaredThrowable();
View Full Code Here

      throw (RuntimeException) e;
    }

    // invoked via reflection
    if (e instanceof InvocationTargetException) {
      InvocationTargetException invokedViaReflection = (InvocationTargetException)e;
      if (invokedViaReflection.getTargetException() != null &&
          invokedViaReflection.getTargetException() instanceof RuntimeException)
        throw (RuntimeException)(invokedViaReflection.getTargetException());
      else {
        Exception realException = (Exception)invokedViaReflection.getTargetException();
        if (realException != null)
          return realException;
      }
    }
View Full Code Here

               invocationHasReachedAServer(invocation);
               if( cause instanceof Exception )
                  throw (Exception) cause;
               else if (cause instanceof Error)
                  throw (Error) cause;
               throw new InvocationTargetException(cause);
            }
         }
         catch (java.net.ConnectException e)
         {
            lastException = e;
View Full Code Here

      {
         t = JMXExceptionDecoder.decode(t);
         // Unwrap any reflection InvocationTargetExceptions
         if( t instanceof InvocationTargetException )
         {
            InvocationTargetException ite = (InvocationTargetException) t;
            t = ite.getTargetException();
         }
         /* Wrap the exception in an InvocationException to distinguish
            between application and transport exceptions
         */
         InvocationException appException = new InvocationException(t);
View Full Code Here

                templateMethodCache.put(classFile, ref);
            }

        } catch (final ClassNotFoundException e) {
            Log.logSevere("HTTPDFileHandler", "class " + classFile + " is missing:" + e.getMessage());
            throw new InvocationTargetException(e, "class " + classFile + " is missing:" + e.getMessage());
        } catch (final NoSuchMethodException e) {
            Log.logSevere("HTTPDFileHandler", "method 'respond' not found in class " + classFile + ": " + e.getMessage());
            throw new InvocationTargetException(e, "method 'respond' not found in class " + classFile + ": " + e.getMessage());
        }
        return m;
    }
View Full Code Here

            }
            catch (Exception e)
            {
                if (e instanceof InvocationTargetException)
                {
                    InvocationTargetException ite = (InvocationTargetException)e;
                    throw new NucleusException(LOCALISER_RDBMS.msg("047004", poolingType,
                        ite.getTargetException().getMessage()), ite.getTargetException()).setFatal();
                }
                else
                {
                    throw new NucleusException(LOCALISER_RDBMS.msg("047004", poolingType,
                        e.getMessage()),e).setFatal();
View Full Code Here

    else
    {
      Throwable fault = message.getFault();
      if (fault instanceof InvocationTargetException)
      {
        InvocationTargetException invi = (InvocationTargetException) fault;
        Throwable inviFault = invi.getTargetException();
        if (inviFault != null)
          this.writeFault(inviFault.getClass().getSimpleName(), inviFault.getMessage(), inviFault);
        else
          this.writeFault(fault.getClass().getSimpleName(), fault.getMessage(), fault);
      }
View Full Code Here

  public static Throwable unwrapThrow(Throwable e) {
    if (e == null)
      return null;
    if (e instanceof InvocationTargetException) {
      InvocationTargetException itE = (InvocationTargetException) e;
      if (itE.getTargetException() != null)
        return unwrapThrow(itE.getTargetException());
    }
    if (e.getCause() != null)
      return unwrapThrow(e.getCause());
    return e;
  }
View Full Code Here

    private static void safeInvokeAndWait(Runnable runnable) throws InvocationTargetException, InterruptedException {
        if (EventQueue.isDispatchThread()) {
            try {
                runnable.run();
            } catch (Exception e) {
                throw new InvocationTargetException(e);
            }
        } else {
            EventQueue.invokeAndWait(runnable);
        }
    }
View Full Code Here

TOP

Related Classes of java.lang.reflect.InvocationTargetException

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.