Code example for ExecutionException

0
 
    public T get() throws InterruptedException, ExecutionException { 
        try { 
            return get(0, TimeUnit.MILLISECONDS);
        } catch (final TimeoutException ex) {
            throw new ExecutionException(ex);
        } 
    } 
 
    public T get( 
            final long timeout,
            final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
        Args.notNull(unit, "Time unit");
        this.lock.lock();
        try { 
            if (this.completed) {
                return this.result;
            } 
            this.result = getPoolEntry(timeout, unit);
            this.completed = true;
            if (this.callback != null) {