001
014
015 package com.liferay.portal.kernel.executor;
016
017 import com.liferay.portal.kernel.concurrent.ThreadPoolExecutor;
018
019 import java.util.concurrent.Callable;
020 import java.util.concurrent.ExecutionException;
021 import java.util.concurrent.Future;
022 import java.util.concurrent.TimeUnit;
023 import java.util.concurrent.TimeoutException;
024
025
028 public interface PortalExecutorManager {
029
030 public <T> Future<T> execute(String name, Callable<T> callable);
031
032 public <T> T execute(
033 String name, Callable<T> callable, long timeout, TimeUnit timeUnit)
034 throws ExecutionException, InterruptedException, TimeoutException;
035
036 public ThreadPoolExecutor getPortalExecutor(String name);
037
038 public ThreadPoolExecutor getPortalExecutor(
039 String name, boolean createIfAbsent);
040
041 public ThreadPoolExecutor registerPortalExecutor(
042 String name, ThreadPoolExecutor threadPoolExecutor);
043
044 public void shutdown();
045
046 public void shutdown(boolean interrupt);
047
048 public void shutdown(String name);
049
050 public void shutdown(String name, boolean interrupt);
051
052 }