public class ExecutorThreadModel extends Object implements ThreadModel
ThreadModel
which represents a thread model with an Executor
per service. The default underlying Executor
is ThreadPoolExecutor
,
so you can safely downcast the returned Executor
of getExecutor()
to
ThreadPoolExecutor
by default.MANUAL
NOOP
Modifier and Type | Method and Description |
---|---|
void |
buildFilterChain(IoFilterChain chain)
Modifies the specified chain.
|
Executor |
getExecutor()
Returns the underlying
Executor of this model. |
static ExecutorThreadModel |
getInstance(String serviceName)
Returns a
ExecutorThreadModel instance for the specified serviceName. |
void |
setExecutor(Executor executor)
Changes the underlying
Executor of this model. |
public static ExecutorThreadModel getInstance(String serviceName)
ExecutorThreadModel
instance for the specified serviceName.
Please note that all returned instances will be managed globally; the same instance
will be returned if you specified the same service name. Please try to specify
different names for different services.serviceName
- the name of the service that needs thread poolingpublic Executor getExecutor()
public void setExecutor(Executor executor)
Executor
of this model.
Previous settings such as the number of threads should be configured again.
Only newly created IoSession
s will be affected.executor
- null to revert to the default settingpublic void buildFilterChain(IoFilterChain chain) throws Exception
IoFilterChainBuilder
buildFilterChain
in interface IoFilterChainBuilder
Exception
Copyright © 2004–2015 Apache MINA Project. All rights reserved.