All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
java.util.concurrent.ThreadPoolExecutor Maven / Gradle / Ivy
package java.util.concurrent;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class ThreadPoolExecutor implements ExecutorService {
public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue) {
}
public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue, ThreadFactory threadFactory) {
}
public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue, RejectedExecutionHandler handler) {
}
public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler) {
}
@Override
public void shutdown() {
}
@Override
public List shutdownNow() {
return new ArrayList();
}
@Override
public boolean isShutdown() {
return false;
}
@Override
public boolean isTerminated() {
return true;
}
@Override
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
return true;
}
@Override
public Future submit(Callable task) {
try {
return new ImmediateFuture(task.call());
} catch (Exception e) {
return new ImmediateFuture(null);
}
}
@Override
public Future submit(Runnable task, T result) {
task.run();
return new ImmediateFuture(result);
}
@Override
public Future> submit(Runnable task) {
return submit(task, null);
}
@Override
public List> invokeAll(Collection extends Callable> tasks) throws InterruptedException {
ArrayList> out = new ArrayList>();
for (Callable task : tasks) {
try {
out.add(new ImmediateFuture(task.call()));
} catch (Exception e) {
e.printStackTrace();
}
}
return out;
}
@Override
public List> invokeAll(Collection extends Callable> tasks, long timeout, TimeUnit unit) throws InterruptedException {
return invokeAll(tasks);
}
@Override
public T invokeAny(Collection extends Callable> tasks) throws InterruptedException, ExecutionException {
for (Callable task : tasks) {
try {
return task.call();
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
}
@Override
public T invokeAny(Collection extends Callable> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
return invokeAny(tasks);
}
@Override
public void execute(Runnable command) {
command.run();
}
}