Java Thread Future getAll(List> futures)

Here you can find the source of getAll(List> futures)

Description

get All

License

Apache License

Declaration

public static void getAll(List<Future<Object>> futures) 

Method Source Code


//package com.java2s;
/*//from  w  ww. j  a  v  a  2  s. c  om
Copyright 2015-2016 Artem Stasiuk
    
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    
http://www.apache.org/licenses/LICENSE-2.0
    
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 */

import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

public class Main {
    public static void getAll(List<Future<Object>> futures) {
        for (final Future future : futures) {
            try {
                future.get();
            } catch (ExecutionException | InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}

Related

  1. commit(Object tx)
  2. convertFuture(Future future)
  3. createFuture()
  4. exceptionallyCompletedFuture( final Throwable e)
  5. exceptionallyCompletedFuture(final Throwable t)
  6. getAll(List> futures)
  7. getAllDone(Collection futures)
  8. getExceptionFromNewThread(String threadName, Runnable target)
  9. getFailedFuture(Throwable throwable)