Coverage Summary for Class: WrappingScheduledExecutorService (com.google.common.util.concurrent)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| WrappingScheduledExecutorService | 0% (0/1) | 0% (0/5) | 0% (0/6) |
1 /* 2 * Copyright (C) 2013 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.errorprone.annotations.CanIgnoreReturnValue; 19 import java.util.concurrent.Callable; 20 import java.util.concurrent.ScheduledExecutorService; 21 import java.util.concurrent.ScheduledFuture; 22 import java.util.concurrent.TimeUnit; 23 import org.checkerframework.checker.nullness.qual.Nullable; 24 25 /** 26 * An abstract {@code ScheduledExecutorService} that allows subclasses to {@linkplain 27 * #wrapTask(Callable) wrap} tasks before they are submitted to the underlying executor. 28 * 29 * <p>Note that task wrapping may occur even if the task is never executed. 30 * 31 * @author Luke Sandberg 32 */ 33 @CanIgnoreReturnValue // TODO(cpovirk): Consider being more strict. 34 @GwtIncompatible 35 @ElementTypesAreNonnullByDefault 36 abstract class WrappingScheduledExecutorService extends WrappingExecutorService 37 implements ScheduledExecutorService { 38 final ScheduledExecutorService delegate; 39 40 protected WrappingScheduledExecutorService(ScheduledExecutorService delegate) { 41 super(delegate); 42 this.delegate = delegate; 43 } 44 45 @Override 46 public final ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { 47 return delegate.schedule(wrapTask(command), delay, unit); 48 } 49 50 @Override 51 public final <V extends @Nullable Object> ScheduledFuture<V> schedule( 52 Callable<V> task, long delay, TimeUnit unit) { 53 return delegate.schedule(wrapTask(task), delay, unit); 54 } 55 56 @Override 57 public final ScheduledFuture<?> scheduleAtFixedRate( 58 Runnable command, long initialDelay, long period, TimeUnit unit) { 59 return delegate.scheduleAtFixedRate(wrapTask(command), initialDelay, period, unit); 60 } 61 62 @Override 63 public final ScheduledFuture<?> scheduleWithFixedDelay( 64 Runnable command, long initialDelay, long delay, TimeUnit unit) { 65 return delegate.scheduleWithFixedDelay(wrapTask(command), initialDelay, delay, unit); 66 } 67 }