public class BaseExecutorServiceManager
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.ExecutorServiceManager
ExecutorServiceManager
which can be used for implementationsConstructor and Description |
---|
BaseExecutorServiceManager(org.apache.camel.CamelContext camelContext) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(ExecutorService executorService,
long shutdownAwaitTermination) |
protected ThreadFactory |
createThreadFactory(String name,
boolean isDaemon) |
protected void |
doInit() |
protected void |
doShutdown() |
protected void |
doStart() |
org.apache.camel.CamelContext |
getCamelContext() |
org.apache.camel.spi.ThreadPoolProfile |
getDefaultThreadPoolProfile() |
long |
getShutdownAwaitTermination() |
String |
getThreadNamePattern() |
org.apache.camel.spi.ThreadPoolFactory |
getThreadPoolFactory() |
org.apache.camel.spi.ThreadPoolProfile |
getThreadPoolProfile(String id) |
ExecutorService |
newCachedThreadPool(Object source,
String name) |
ScheduledExecutorService |
newDefaultScheduledThreadPool(Object source,
String name) |
ExecutorService |
newDefaultThreadPool(Object source,
String name) |
ExecutorService |
newFixedThreadPool(Object source,
String name,
int poolSize) |
ScheduledExecutorService |
newScheduledThreadPool(Object source,
String name,
int poolSize) |
ScheduledExecutorService |
newScheduledThreadPool(Object source,
String name,
String profileId) |
ScheduledExecutorService |
newScheduledThreadPool(Object source,
String name,
org.apache.camel.spi.ThreadPoolProfile profile) |
ExecutorService |
newSingleThreadExecutor(Object source,
String name) |
ScheduledExecutorService |
newSingleThreadScheduledExecutor(Object source,
String name) |
Thread |
newThread(String name,
Runnable runnable) |
ExecutorService |
newThreadPool(Object source,
String name,
int poolSize,
int maxPoolSize) |
ExecutorService |
newThreadPool(Object source,
String name,
String profileId) |
ExecutorService |
newThreadPool(Object source,
String name,
org.apache.camel.spi.ThreadPoolProfile profile) |
protected void |
onNewExecutorService(ExecutorService executorService)
Strategy callback when a new
ExecutorService have been created. |
void |
registerThreadPoolProfile(org.apache.camel.spi.ThreadPoolProfile profile) |
String |
resolveThreadName(String name) |
void |
setDefaultThreadPoolProfile(org.apache.camel.spi.ThreadPoolProfile defaultThreadPoolProfile) |
void |
setShutdownAwaitTermination(long shutdownAwaitTermination) |
void |
setThreadNamePattern(String threadNamePattern) |
void |
setThreadPoolFactory(org.apache.camel.spi.ThreadPoolFactory threadPoolFactory) |
void |
shutdown(ExecutorService executorService) |
void |
shutdownGraceful(ExecutorService executorService) |
void |
shutdownGraceful(ExecutorService executorService,
long shutdownAwaitTermination) |
List<Runnable> |
shutdownNow(ExecutorService executorService) |
build, doBuild, doFail, doLifecycleChange, doResume, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public BaseExecutorServiceManager(org.apache.camel.CamelContext camelContext)
public org.apache.camel.CamelContext getCamelContext()
public org.apache.camel.spi.ThreadPoolFactory getThreadPoolFactory()
getThreadPoolFactory
in interface org.apache.camel.spi.ExecutorServiceManager
public void setThreadPoolFactory(org.apache.camel.spi.ThreadPoolFactory threadPoolFactory)
setThreadPoolFactory
in interface org.apache.camel.spi.ExecutorServiceManager
public void registerThreadPoolProfile(org.apache.camel.spi.ThreadPoolProfile profile)
registerThreadPoolProfile
in interface org.apache.camel.spi.ExecutorServiceManager
public org.apache.camel.spi.ThreadPoolProfile getThreadPoolProfile(String id)
getThreadPoolProfile
in interface org.apache.camel.spi.ExecutorServiceManager
public org.apache.camel.spi.ThreadPoolProfile getDefaultThreadPoolProfile()
getDefaultThreadPoolProfile
in interface org.apache.camel.spi.ExecutorServiceManager
public void setDefaultThreadPoolProfile(org.apache.camel.spi.ThreadPoolProfile defaultThreadPoolProfile)
setDefaultThreadPoolProfile
in interface org.apache.camel.spi.ExecutorServiceManager
public String getThreadNamePattern()
getThreadNamePattern
in interface org.apache.camel.spi.ExecutorServiceManager
public void setThreadNamePattern(String threadNamePattern)
setThreadNamePattern
in interface org.apache.camel.spi.ExecutorServiceManager
public long getShutdownAwaitTermination()
getShutdownAwaitTermination
in interface org.apache.camel.spi.ExecutorServiceManager
public void setShutdownAwaitTermination(long shutdownAwaitTermination)
setShutdownAwaitTermination
in interface org.apache.camel.spi.ExecutorServiceManager
public String resolveThreadName(String name)
resolveThreadName
in interface org.apache.camel.spi.ExecutorServiceManager
public Thread newThread(String name, Runnable runnable)
newThread
in interface org.apache.camel.spi.ExecutorServiceManager
public ExecutorService newDefaultThreadPool(Object source, String name)
newDefaultThreadPool
in interface org.apache.camel.spi.ExecutorServiceManager
public ScheduledExecutorService newDefaultScheduledThreadPool(Object source, String name)
newDefaultScheduledThreadPool
in interface org.apache.camel.spi.ExecutorServiceManager
public ExecutorService newThreadPool(Object source, String name, String profileId)
newThreadPool
in interface org.apache.camel.spi.ExecutorServiceManager
public ExecutorService newThreadPool(Object source, String name, org.apache.camel.spi.ThreadPoolProfile profile)
newThreadPool
in interface org.apache.camel.spi.ExecutorServiceManager
public ExecutorService newThreadPool(Object source, String name, int poolSize, int maxPoolSize)
newThreadPool
in interface org.apache.camel.spi.ExecutorServiceManager
public ExecutorService newSingleThreadExecutor(Object source, String name)
newSingleThreadExecutor
in interface org.apache.camel.spi.ExecutorServiceManager
public ExecutorService newCachedThreadPool(Object source, String name)
newCachedThreadPool
in interface org.apache.camel.spi.ExecutorServiceManager
public ExecutorService newFixedThreadPool(Object source, String name, int poolSize)
newFixedThreadPool
in interface org.apache.camel.spi.ExecutorServiceManager
public ScheduledExecutorService newSingleThreadScheduledExecutor(Object source, String name)
newSingleThreadScheduledExecutor
in interface org.apache.camel.spi.ExecutorServiceManager
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, org.apache.camel.spi.ThreadPoolProfile profile)
newScheduledThreadPool
in interface org.apache.camel.spi.ExecutorServiceManager
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, String profileId)
newScheduledThreadPool
in interface org.apache.camel.spi.ExecutorServiceManager
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, int poolSize)
newScheduledThreadPool
in interface org.apache.camel.spi.ExecutorServiceManager
public void shutdown(ExecutorService executorService)
shutdown
in interface org.apache.camel.spi.ExecutorServiceManager
public void shutdownGraceful(ExecutorService executorService)
shutdownGraceful
in interface org.apache.camel.spi.ExecutorServiceManager
public void shutdownGraceful(ExecutorService executorService, long shutdownAwaitTermination)
shutdownGraceful
in interface org.apache.camel.spi.ExecutorServiceManager
public List<Runnable> shutdownNow(ExecutorService executorService)
shutdownNow
in interface org.apache.camel.spi.ExecutorServiceManager
public boolean awaitTermination(ExecutorService executorService, long shutdownAwaitTermination) throws InterruptedException
awaitTermination
in interface org.apache.camel.spi.ExecutorServiceManager
InterruptedException
protected void onNewExecutorService(ExecutorService executorService)
ExecutorService
have been created.executorService
- the created ExecutorService
protected void doInit() throws Exception
doInit
in class org.apache.camel.support.service.BaseService
Exception
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.service.BaseService
Exception
protected void doShutdown() throws Exception
doShutdown
in class org.apache.camel.support.service.BaseService
Exception
protected ThreadFactory createThreadFactory(String name, boolean isDaemon)
Apache Camel