Package java.util.concurrent

Examples of java.util.concurrent.ExecutorService.awaitTermination()


                });
            }
        } finally {
            exec.shutdown();
            try {
                exec.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                ;
            }
        }
View Full Code Here


                });
            }
        } finally {
            exec.shutdown();
            try {
                exec.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                ;
            }
        }
View Full Code Here

                });
            }
        } finally {
            exec.shutdown();
            try {
                exec.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                ;
            }
        }
View Full Code Here

                });
            }
        } finally {
            exec.shutdown();
            try {
                exec.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                ;
            }
        }
View Full Code Here

    try {
      FetchRssDataWorker worker = new FetchRssDataWorker(url);
      service = Executors.newFixedThreadPool(1);
      service.execute(worker);
      service.shutdown();
      service.awaitTermination(5, TimeUnit.SECONDS);
      title = worker.getRssTitle();
      logger.debug("detected RSS title: " + title);
    } catch (Exception e) {
      logger.debug(e);
    } finally {
View Full Code Here

   
        for (Thread ti : t)
            pool.execute(ti);
   
    pool.shutdown();
    pool.awaitTermination(20, TimeUnit.SECONDS);

        for (int i = 0; i < x.size(); ++i)
            assertEquals(x.get(i), output[i], 1e-10);
    }
View Full Code Here

        Thread.sleep(100);
      }
    }

    es.shutdown();
    es.awaitTermination(1, TimeUnit.SECONDS);

    if (VERBOSE) {
      System.out.println("TEST: all searching done [" + (System.currentTimeMillis()-t0) + " ms]");
    }
View Full Code Here

          threadPool.execute(thread);
        }
        threadPool.shutdown();
        // Wait for all threads to terminate
        try {
          for(int i = 0; !threadPool.awaitTermination(5, TimeUnit.SECONDS); i++) {
            LOG.debug("Waiting for hlog writers to terminate, iteration #" + i);
          }
        }catch(InterruptedException ex) {
          LOG.warn("Hlog writers were interrupted, possible data loss!");
        }
View Full Code Here

                    provider.getResourceBundle(language);
                }
            });
        }
        executor.shutdown();
        executor.awaitTermination(5, TimeUnit.SECONDS);

        verifyPrivate(provider, times(1)).invoke("createResourceBundle", eq(null), eq(Locale.ENGLISH));
        verifyPrivate(provider, times(1)).invoke("createResourceBundle", eq(null), eq(Locale.GERMAN));
    }
View Full Code Here

            taskList.add(task);
            executor.submit(task);
        }

        executor.shutdown();
        if (!executor.awaitTermination(10,
            TimeUnit.MINUTES)) {
                throw new TimeoutException();
        }
        final long endTime = System.currentTimeMillis();
        int count = 0;
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.