public class DefaultExecutors extends java.lang.Object implements OddjobExecutors, Stoppable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
POOL_SIZE_PROPERTY |
Constructor and Description |
---|
DefaultExecutors()
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getPoolBaseName() |
java.util.concurrent.ExecutorService |
getPoolExecutor()
Provide a
ExecutorService . |
int |
getPoolSize()
Get the pool size for the scheduled executor.
|
java.util.concurrent.ScheduledExecutorService |
getScheduledExecutor()
Provide a
ScheduledExecutorService . |
boolean |
isShareServices() |
void |
setPoolBaseName(java.lang.String poolBaseName) |
void |
setPoolSize(int poolSize)
Set the pool size for the scheduled executor.
|
void |
setShareServices(boolean shareServices)
Share the same service between the executor service and the scheduled
executor service.
|
void |
stop()
Stop the services.
|
java.lang.String |
toString() |
public static final java.lang.String POOL_SIZE_PROPERTY
public DefaultExecutors()
poolBaseName
- Name that will prefix threads.public java.util.concurrent.ScheduledExecutorService getScheduledExecutor()
OddjobExecutors
ScheduledExecutorService
.getScheduledExecutor
in interface OddjobExecutors
public java.util.concurrent.ExecutorService getPoolExecutor()
OddjobExecutors
ExecutorService
. Implementations are free to
use OddjobExecutors.getScheduledExecutor()
for this, or provide
something different.getPoolExecutor
in interface OddjobExecutors
public int getPoolSize()
public void setPoolSize(int poolSize)
poolSize
- The pool size.public boolean isShareServices()
public void setShareServices(boolean shareServices)
shareServices
- public java.lang.String getPoolBaseName()
public void setPoolBaseName(java.lang.String poolBaseName)
public java.lang.String toString()
toString
in class java.lang.Object