@InterfaceAudience.Private public class ExecutorService extends Object
EventTypes can be submitted,
and a Runnable that handles the object that is added to the queue.
In order to create a new service, create an instance of this class and
then do: instance.startExecutorService("myService");. When done
call shutdown().
In order to use the service created above, call
submit(EventHandler).
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ExecutorService.ExecutorStatus
A snapshot of the status of a particular executor.
|
static class |
ExecutorService.RunningEventStatus
The status of a particular event that is in the middle of being
handled by an executor.
|
| 构造器和说明 |
|---|
ExecutorService(String servername)
Default constructor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Map<String,ExecutorService.ExecutorStatus> |
getAllExecutorStatuses() |
ThreadPoolExecutor |
getExecutorLazily(ExecutorType type,
int maxThreads)
Initialize the executor lazily, Note if an executor need to be initialized lazily, then all
paths should use this method to get the executor, should not start executor by using
startExecutorService(ExecutorType, int) |
ThreadPoolExecutor |
getExecutorThreadPool(ExecutorType type) |
void |
shutdown() |
void |
startExecutorService(ExecutorType type,
int maxThreads) |
void |
startExecutorService(String name,
int maxThreads)
Start an executor service with a given name.
|
void |
submit(EventHandler eh) |
public ExecutorService(String servername)
servername - Name of the hosting server.public void startExecutorService(String name, int maxThreads)
name - Name of the service to start.public void shutdown()
public ThreadPoolExecutor getExecutorThreadPool(ExecutorType type)
public void startExecutorService(ExecutorType type, int maxThreads)
public ThreadPoolExecutor getExecutorLazily(ExecutorType type, int maxThreads)
startExecutorService(ExecutorType, int)public void submit(EventHandler eh)
public Map<String,ExecutorService.ExecutorStatus> getAllExecutorStatuses()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.