Coverage Summary for Class: ForwardingExecutorService (com.google.common.util.concurrent)

Class Class, % Method, % Line, %
ForwardingExecutorService 0% (0/1) 0% (0/14) 0% (0/14)


1 /* 2  * Copyright (C) 2011 The Guava Authors 3  * 4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5  * in compliance with the License. You may obtain a copy of the License at 6  * 7  * http://www.apache.org/licenses/LICENSE-2.0 8  * 9  * Unless required by applicable law or agreed to in writing, software distributed under the License 10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11  * or implied. See the License for the specific language governing permissions and limitations under 12  * the License. 13  */ 14  15 package com.google.common.util.concurrent; 16  17 import com.google.common.annotations.GwtIncompatible; 18 import com.google.common.collect.ForwardingObject; 19 import com.google.errorprone.annotations.CanIgnoreReturnValue; 20 import java.util.Collection; 21 import java.util.List; 22 import java.util.concurrent.Callable; 23 import java.util.concurrent.ExecutionException; 24 import java.util.concurrent.ExecutorService; 25 import java.util.concurrent.Future; 26 import java.util.concurrent.TimeUnit; 27 import java.util.concurrent.TimeoutException; 28 import org.checkerframework.checker.nullness.qual.Nullable; 29  30 /** 31  * An executor service which forwards all its method calls to another executor service. Subclasses 32  * should override one or more methods to modify the behavior of the backing executor service as 33  * desired per the <a href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>. 34  * 35  * @author Kurt Alfred Kluever 36  * @since 10.0 37  */ 38 @CanIgnoreReturnValue // TODO(cpovirk): Consider being more strict. 39 @GwtIncompatible 40 @ElementTypesAreNonnullByDefault 41 public abstract class ForwardingExecutorService extends ForwardingObject 42  implements ExecutorService { 43  /** Constructor for use by subclasses. */ 44  protected ForwardingExecutorService() {} 45  46  @Override 47  protected abstract ExecutorService delegate(); 48  49  @Override 50  public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { 51  return delegate().awaitTermination(timeout, unit); 52  } 53  54  @Override 55  public <T extends @Nullable Object> List<Future<T>> invokeAll( 56  Collection<? extends Callable<T>> tasks) throws InterruptedException { 57  return delegate().invokeAll(tasks); 58  } 59  60  @Override 61  public <T extends @Nullable Object> List<Future<T>> invokeAll( 62  Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) 63  throws InterruptedException { 64  return delegate().invokeAll(tasks, timeout, unit); 65  } 66  67  @Override 68  public <T extends @Nullable Object> T invokeAny(Collection<? extends Callable<T>> tasks) 69  throws InterruptedException, ExecutionException { 70  return delegate().invokeAny(tasks); 71  } 72  73  @Override 74  public <T extends @Nullable Object> T invokeAny( 75  Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) 76  throws InterruptedException, ExecutionException, TimeoutException { 77  return delegate().invokeAny(tasks, timeout, unit); 78  } 79  80  @Override 81  public boolean isShutdown() { 82  return delegate().isShutdown(); 83  } 84  85  @Override 86  public boolean isTerminated() { 87  return delegate().isTerminated(); 88  } 89  90  @Override 91  public void shutdown() { 92  delegate().shutdown(); 93  } 94  95  @Override 96  public List<Runnable> shutdownNow() { 97  return delegate().shutdownNow(); 98  } 99  100  @Override 101  public void execute(Runnable command) { 102  delegate().execute(command); 103  } 104  105  @Override 106  public <T extends @Nullable Object> Future<T> submit(Callable<T> task) { 107  return delegate().submit(task); 108  } 109  110  @Override 111  public Future<?> submit(Runnable task) { 112  return delegate().submit(task); 113  } 114  115  @Override 116  public <T extends @Nullable Object> Future<T> submit( 117  Runnable task, @ParametricNullness T result) { 118  return delegate().submit(task, result); 119  } 120 }