Examples of awaitTermination()


Examples of com.amazonaws.services.simpleworkflow.flow.ActivityWorker.awaitTermination()

            public void run() {
                try {
                    workerForCommonTaskList.shutdown();
                    workerForHostSpecificTaskList.shutdown();
                    workerForCommonTaskList.awaitTermination(1, TimeUnit.MINUTES);
                    workerForHostSpecificTaskList.awaitTermination(1, TimeUnit.MINUTES);
                    System.out.println("Activity Workers Exited.");
                }
                catch (InterruptedException e) {
                    e.printStackTrace();
                }
View Full Code Here

Examples of com.codahale.metrics.InstrumentedExecutorService.awaitTermination()

                    cacheSynchronizer.waitForEmptyCaches(configuration.getShutdownTimeout(), TimeUnit.MILLISECONDS);
                }
            });

            executorService.shutdown();
            executorService.awaitTermination(configuration.getShutdownTimeout(), TimeUnit.MILLISECONDS);
        } else {
            LOG.warn("Elasticsearch is unavailable. Not waiting to clear buffers and caches, as we have no healthy cluster.");
        }
        LOG.debug("Stopped BufferSynchronizerService");
    }
View Full Code Here

Examples of com.google.common.util.concurrent.ListeningExecutorService.awaitTermination()

                                            assertEquals(generator.next(), fixedTime * 1000 + i);
                                    }
                                }));
        }
        executor.shutdown();
        executor.awaitTermination(1, TimeUnit.SECONDS);

        try {
            Futures.allAsList(futures).get();
        } catch (ExecutionException e) {
            Throwable cause = e.getCause();
View Full Code Here

Examples of com.google.common.util.concurrent.ListeningExecutorService.awaitTermination()

                                            allTimestamps.add(generator.next());
                                    }
                                }));
        }
        executor.shutdown();
        executor.awaitTermination(1, TimeUnit.SECONDS);

        try {
            Futures.allAsList(futures).get();
        } catch (ExecutionException e) {
            Throwable cause = e.getCause();
View Full Code Here

Examples of com.packtpub.java7.concurrency.chapter7.recipe01.executor.MyExecutor.awaitTermination()

   
    /*
     * Wait for the finalization of the Executor
     */
    try {
      myExecutor.awaitTermination(1, TimeUnit.DAYS);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
   
    /*
 
View Full Code Here

Examples of com.packtpub.java7.concurrency.chapter7.recipe05.task.MyScheduledThreadPoolExecutor.awaitTermination()

    executor.shutdown();
   
    /*
     * Wait for the finalization of the executor
     */
    executor.awaitTermination(1, TimeUnit.DAYS);
   
    /*
     * Write a message indicating the end of the program
     */
    System.out.printf("Main: End of the program.\n");
View Full Code Here

Examples of com.sun.sgs.nio.channels.AsynchronousChannelGroup.awaitTermination()

                TimeUnit.SECONDS.toNanos(ops) / elapsed
            );

        group.shutdown();
        log.info("Awaiting group termination");       
        if (! group.awaitTermination(5, TimeUnit.SECONDS)) {
            log.warning("Forcing group termination");
            group.shutdownNow();
            if (! group.awaitTermination(5, TimeUnit.SECONDS)) {
                log.warning("Group could not be forcibly terminated");
            }
View Full Code Here

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

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

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
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.