Example usage for com.google.common.util.concurrent ListeningScheduledExecutorService isTerminated

List of usage examples for com.google.common.util.concurrent ListeningScheduledExecutorService isTerminated

Introduction

In this page you can find the example usage for com.google.common.util.concurrent ListeningScheduledExecutorService isTerminated.

Prototype

boolean isTerminated();

Source Link

Document

Returns true if all tasks have completed following shut down.

Usage

From source file:org.eclipse.osee.executor.admin.internal.ExecutorAdminImpl.java

public ListeningScheduledExecutorService getScheduledExecutor(String id) {
    ListeningScheduledExecutorService service = null;
    synchronized (cache) {
        ListeningExecutorService executor = cache.getById(id);
        if (executor instanceof ListeningScheduledExecutorService) {
            service = (ListeningScheduledExecutorService) executor;
        } else {// w w  w .  j  av a 2 s  .co m
            service = createScheduledExecutor(id, -1);
        }
    }
    if (service == null) {
        throw new OseeStateException("Error creating executor [%s].", id);
    }
    if (service.isShutdown() || service.isTerminated()) {
        throw new OseeStateException("Error executor [%s] was previously shutdown.", id);
    }
    return service;
}