1
17 package org.apache.tomcat.util.threads;
18
19 import java.util.Collection;
20 import java.util.List;
21 import java.util.concurrent.Callable;
22 import java.util.concurrent.ExecutionException;
23 import java.util.concurrent.Future;
24 import java.util.concurrent.ScheduledExecutorService;
25 import java.util.concurrent.ScheduledFuture;
26 import java.util.concurrent.TimeUnit;
27 import java.util.concurrent.TimeoutException;
28
29
33 public class ScheduledThreadPoolExecutor implements ScheduledExecutorService {
34
35 protected final ScheduledExecutorService executor;
36
37
41 public ScheduledThreadPoolExecutor(ScheduledExecutorService executor) {
42 this.executor = executor;
43 }
44
45 @Override
46 public void shutdown() {
47
48 }
49
50
51 @Override
52 public List<Runnable> shutdownNow() {
53 return null;
54 }
55
56 @Override
57 public boolean isShutdown() {
58 return executor.isShutdown();
59 }
60
61 @Override
62 public boolean isTerminated() {
63 return executor.isTerminated();
64 }
65
66 @Override
67 public boolean awaitTermination(long timeout, TimeUnit unit)
68 throws InterruptedException {
69 return executor.awaitTermination(timeout, unit);
70 }
71
72 @Override
73 public <T> Future<T> submit(Callable<T> task) {
74 return executor.submit(task);
75 }
76
77 @Override
78 public <T> Future<T> submit(Runnable task, T result) {
79 return executor.submit(task, result);
80 }
81
82 @Override
83 public Future<?> submit(Runnable task) {
84 return executor.submit(task);
85 }
86
87 @Override
88 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
89 throws InterruptedException {
90 return executor.invokeAll(tasks);
91 }
92
93 @Override
94 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout,
95 TimeUnit unit) throws InterruptedException {
96 return executor.invokeAll(tasks, timeout, unit);
97 }
98
99 @Override
100 public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
101 throws InterruptedException, ExecutionException {
102 return executor.invokeAny(tasks);
103 }
104
105 @Override
106 public <T> T invokeAny(Collection<? extends Callable<T>> tasks,
107 long timeout, TimeUnit unit)
108 throws InterruptedException, ExecutionException, TimeoutException {
109 return executor.invokeAny(tasks, timeout, unit);
110 }
111
112 @Override
113 public void execute(Runnable command) {
114 executor.execute(command);
115 }
116
117 @Override
118 public ScheduledFuture<?> schedule(Runnable command, long delay,
119 TimeUnit unit) {
120 return executor.schedule(command, delay, unit);
121 }
122
123 @Override
124 public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay,
125 TimeUnit unit) {
126 return executor.schedule(callable, delay, unit);
127 }
128
129 @Override
130 public ScheduledFuture<?> scheduleAtFixedRate(Runnable command,
131 long initialDelay, long period, TimeUnit unit) {
132 return executor.scheduleAtFixedRate(command, initialDelay, period, unit);
133 }
134
135 @Override
136 public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
137 long initialDelay, long delay, TimeUnit unit) {
138 return executor.scheduleWithFixedDelay(command, initialDelay, delay, unit);
139 }
140
141 }
142