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

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

Introduction

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

Prototype

boolean isShutdown();

Source Link

Document

Returns true if this executor has been 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  . ja v  a2 s  . c  o  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;
}