List of usage examples for com.google.common.util.concurrent ExecutionList ExecutionList
public ExecutionList()
From source file:org.apache.brooklyn.util.core.task.ListenableForwardingFuture.java
protected ListenableForwardingFuture(Future<T> delegate) { super(delegate); this.listeners = new ExecutionList(); }
From source file:org.jclouds.lifecycle.config.LifeCycleModule.java
protected void configure() { Closeable executorCloser = new Closeable() { @Inject/*from w ww. j ava2 s. c o m*/ @Named(PROPERTY_USER_THREADS) ListeningExecutorService userExecutor; @Inject @Named(PROPERTY_IO_WORKER_THREADS) ListeningExecutorService ioExecutor; // ScheduledExecutor is defined in an optional module @Inject(optional = true) @Named(PROPERTY_SCHEDULER_THREADS) ScheduledExecutorService scheduledExecutor; public void close() throws IOException { assert userExecutor != null; userExecutor.shutdownNow(); assert ioExecutor != null; ioExecutor.shutdownNow(); // ScheduledExecutor is defined in an optional module if (scheduledExecutor != null) scheduledExecutor.shutdownNow(); } }; binder().requestInjection(executorCloser); Closer closer = new Closer(); closer.addToClose(executorCloser); bind(Closer.class).toInstance(closer); ExecutionList list = new ExecutionList(); bindPostInjectionInvoke(closer, list); bind(ExecutionList.class).toInstance(list); }
From source file:org.apache.gobblin.runtime.job_exec.JobLauncherExecutionDriver.java
protected JobLauncherExecutionDriver(JobSpec jobSpec, Logger log, DriverRunnable runnable) { super(runnable); _closer = Closer.create();//from ww w .ja v a2 s .com _closer.register(runnable.getJobLauncher()); _log = log; _jobSpec = jobSpec; _jobExec = runnable.getJobExec(); _callbackDispatcher = _closer.register(runnable.getCallbackDispatcher()); _jobState = runnable.getJobState(); _executionList = new ExecutionList(); _runnable = runnable; }