Package java.util.concurrent

Examples of java.util.concurrent.ExecutionException


    }


    public void testDoubleNestedWithThread()
    {
        ExecutionException e = getDoubleNestedException();

        String name = this.getClass().getName();
        Throwable focus = findInnermostWithClass( e, name );
        assertEquals( e, focus );
        List<StackTraceElement> stackTraceElements = focusInsideClass( focus.getStackTrace(), name );
        assertEquals( stackTraceElements.get( stackTraceElements.size() - 1 ).getClassName(), name );

        name = "org.apache.maven.surefire.report.RunnableTestClass1";
        focus = findInnermostWithClass( e, name );
        assertEquals( e.getCause(), focus );
        stackTraceElements = focusInsideClass( focus.getStackTrace(), name );
        assertEquals( stackTraceElements.get( stackTraceElements.size() - 1 ).getClassName(), name );

    }
View Full Code Here


         * <p>
         * Always throws the exception this future was constructed with.
         */
        @Override
        public V get() throws ExecutionException {
            throw new ExecutionException(exception);
        }
View Full Code Here

                try {
                    value = valueLoader.call();
                    loadSuccessCount++;
                } catch (Exception e) {
                    loadExceptionCount++;
                    throw new ExecutionException(e);
                } finally {
                    long time = System.nanoTime() - start;
                    totalLoadTime += time;
                }
                put(key, hash, value, cache.sizeOf(key, value));
View Full Code Here

                try {
                    value = loader.load(key);
                    loadSuccessCount++;
                } catch (Exception e) {
                    loadExceptionCount++;
                    throw new ExecutionException(e);
                } finally {
                    long time = System.nanoTime() - start;
                    totalLoadTime += time;
                }
                put(key, hash, value, cache.sizeOf(key, value));
View Full Code Here

                    value = future.get();
                }
                loadSuccessCount++;
            } catch (Exception e) {
                loadExceptionCount++;
                throw new ExecutionException(e);
            } finally {
                long time = System.nanoTime() - start;
                totalLoadTime += time;
            }
            put(key, hash, value, cache.sizeOf(key, value));
View Full Code Here

            boolean isExceptionUnchecked = (e instanceof Error) || (e instanceof RuntimeException);

            // throw checked excpetion and EJBException directly.
            if (!isExceptionUnchecked || e instanceof EJBException) {
                throw new ExecutionException(e);
            }

            // wrap unchecked exception with EJBException before throwing.
            throw (e instanceof Exception) ? new ExecutionException(new EJBException((Exception) e))
                    : new ExecutionException(new EJBException(new Exception(e)));
           
        }
View Full Code Here

      }

      @Override
      public V get() throws InterruptedException, ExecutionException
      {
         throw new ExecutionException(exception);
      }
View Full Code Here

      }

      @Override
      public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
      {
         throw new ExecutionException(exception);
      }
View Full Code Here

        public Record get(final URL key) throws ExecutionException {
            try {
                return this.getFactory().newInstance(key);
            } catch (Exception e) {
                throw new ExecutionException(e);
            }
        }
View Full Code Here

            doJoin() : externalInterruptibleAwaitDone();
      Throwable ex;
      if ((s &= DONE_MASK) == CANCELLED)
         throw new CancellationException();
      if (s == EXCEPTIONAL && (ex = getThrowableException()) != null)
         throw new ExecutionException(ex);
      return getRawResult();
   }
View Full Code Here

TOP

Related Classes of java.util.concurrent.ExecutionException

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.