Package com.google.common.util.concurrent

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


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

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


                                        for (int i = 0; i < 1000 / testThreadsCount; i++)
                                            allTimestamps.add(generator.next());
                                    }
                                }));
        }
        executor.shutdown();
        executor.awaitTermination(1, TimeUnit.SECONDS);

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

      }
    }
    catch (Exception e) {
      log.makeAlert(e, "Cost Balancer Multithread strategy wasn't able to complete cost computation.").emit();
    }
    service.shutdown();
    return bestServer;
  }

}
View Full Code Here

      for (Location jarLocation : Futures.allAsList(futures).get()) {
        programs.add(Programs.create(jarLocation, null));
      }
    } finally {
      executorService.shutdown();
    }

    // Emits the received specification with programs.
    emit(new ApplicationWithPrograms(o, programs.build()));
  }
View Full Code Here

                }));
            }

            // Throws ExecutionException if any of the submitted task failed
            Futures.allAsList(futures).get();
            executorService.shutdown();
            executorService.awaitTermination(1, TimeUnit.DAYS);
        } finally {
            session.logout();
        }
    }
View Full Code Here

                }));
            }

            // Throws ExecutionException if any of the submitted task failed
            Futures.allAsList(futures).get();
            executorService.shutdown();
            executorService.awaitTermination(1, TimeUnit.DAYS);
        } finally {
            session.logout();
        }
    }
View Full Code Here

      } catch (final ExecutionException e) {
        // FIXME need some way to gracefully handle this error. All data
        // should be saved to reproduce this simulation.
        throw new IllegalStateException(e);
      }
      executor.shutdown();

      return new ExperimentResults(this, ImmutableList.copyOf(results));
    }
  }
View Full Code Here

        // Shut down executor on completion
        Futures.addCallback(syncOutcomeFuture, new FutureCallback<Outcome>() {

            @Override
            public void onSuccess(Outcome outcome) {
                exec.shutdown();
            }

            @Override
            public void onFailure(Throwable t) {
                exec.shutdown();
View Full Code Here

                exec.shutdown();
            }

            @Override
            public void onFailure(Throwable t) {
                exec.shutdown();
            }
        }, MoreExecutors.sameThreadExecutor());

        return syncOutcomeFuture;
    }
View Full Code Here

        List<RemoteCommandResult> result = future.get();
        if(result != null) {
          results.addAll(result);
        }
      }
      executor.shutdown();
      return results;
    } finally {
      if(executor.isShutdown()) {
        executor.shutdownNow();
      }
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.