Package org.apache.camel.impl.engine
Class BaseExecutorServiceManager
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.impl.engine.BaseExecutorServiceManager
-
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.ExecutorServiceManager,org.apache.camel.StatefulService,org.apache.camel.StaticService,org.apache.camel.SuspendableService
public class BaseExecutorServiceManager extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.spi.ExecutorServiceManagerBaseExecutorServiceManagerwhich can be used for implementations
-
-
Constructor Summary
Constructors Constructor Description BaseExecutorServiceManager(org.apache.camel.CamelContext camelContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitTermination(ExecutorService executorService, long shutdownAwaitTermination)protected ThreadFactorycreateThreadFactory(String name, boolean isDaemon)protected voiddoInit()protected voiddoShutdown()org.apache.camel.CamelContextgetCamelContext()org.apache.camel.spi.ThreadPoolProfilegetDefaultThreadPoolProfile()longgetShutdownAwaitTermination()StringgetThreadNamePattern()org.apache.camel.spi.ThreadPoolFactorygetThreadPoolFactory()org.apache.camel.spi.ThreadPoolProfilegetThreadPoolProfile(String id)ExecutorServicenewCachedThreadPool(Object source, String name)ScheduledExecutorServicenewDefaultScheduledThreadPool(Object source, String name)ExecutorServicenewDefaultThreadPool(Object source, String name)ExecutorServicenewFixedThreadPool(Object source, String name, int poolSize)ScheduledExecutorServicenewScheduledThreadPool(Object source, String name, int poolSize)ScheduledExecutorServicenewScheduledThreadPool(Object source, String name, String profileId)ScheduledExecutorServicenewScheduledThreadPool(Object source, String name, org.apache.camel.spi.ThreadPoolProfile profile)ExecutorServicenewSingleThreadExecutor(Object source, String name)ScheduledExecutorServicenewSingleThreadScheduledExecutor(Object source, String name)ThreadnewThread(String name, Runnable runnable)ExecutorServicenewThreadPool(Object source, String name, int poolSize, int maxPoolSize)ExecutorServicenewThreadPool(Object source, String name, String profileId)ExecutorServicenewThreadPool(Object source, String name, org.apache.camel.spi.ThreadPoolProfile profile)protected voidonNewExecutorService(ExecutorService executorService)Strategy callback when a newExecutorServicehave been created.voidregisterThreadPoolProfile(org.apache.camel.spi.ThreadPoolProfile profile)StringresolveThreadName(String name)voidsetDefaultThreadPoolProfile(org.apache.camel.spi.ThreadPoolProfile defaultThreadPoolProfile)voidsetShutdownAwaitTermination(long shutdownAwaitTermination)voidsetThreadNamePattern(String threadNamePattern)voidsetThreadPoolFactory(org.apache.camel.spi.ThreadPoolFactory threadPoolFactory)voidshutdown(ExecutorService executorService)voidshutdownGraceful(ExecutorService executorService)voidshutdownGraceful(ExecutorService executorService, long shutdownAwaitTermination)List<Runnable>shutdownNow(ExecutorService executorService)-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()
-
getThreadPoolFactory
public org.apache.camel.spi.ThreadPoolFactory getThreadPoolFactory()
- Specified by:
getThreadPoolFactoryin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
setThreadPoolFactory
public void setThreadPoolFactory(org.apache.camel.spi.ThreadPoolFactory threadPoolFactory)
- Specified by:
setThreadPoolFactoryin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
registerThreadPoolProfile
public void registerThreadPoolProfile(org.apache.camel.spi.ThreadPoolProfile profile)
- Specified by:
registerThreadPoolProfilein interfaceorg.apache.camel.spi.ExecutorServiceManager
-
getThreadPoolProfile
public org.apache.camel.spi.ThreadPoolProfile getThreadPoolProfile(String id)
- Specified by:
getThreadPoolProfilein interfaceorg.apache.camel.spi.ExecutorServiceManager
-
getDefaultThreadPoolProfile
public org.apache.camel.spi.ThreadPoolProfile getDefaultThreadPoolProfile()
- Specified by:
getDefaultThreadPoolProfilein interfaceorg.apache.camel.spi.ExecutorServiceManager
-
setDefaultThreadPoolProfile
public void setDefaultThreadPoolProfile(org.apache.camel.spi.ThreadPoolProfile defaultThreadPoolProfile)
- Specified by:
setDefaultThreadPoolProfilein interfaceorg.apache.camel.spi.ExecutorServiceManager
-
getThreadNamePattern
public String getThreadNamePattern()
- Specified by:
getThreadNamePatternin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
setThreadNamePattern
public void setThreadNamePattern(String threadNamePattern)
- Specified by:
setThreadNamePatternin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
getShutdownAwaitTermination
public long getShutdownAwaitTermination()
- Specified by:
getShutdownAwaitTerminationin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
setShutdownAwaitTermination
public void setShutdownAwaitTermination(long shutdownAwaitTermination)
- Specified by:
setShutdownAwaitTerminationin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
resolveThreadName
public String resolveThreadName(String name)
- Specified by:
resolveThreadNamein interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThread
public Thread newThread(String name, Runnable runnable)
- Specified by:
newThreadin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newDefaultThreadPool
public ExecutorService newDefaultThreadPool(Object source, String name)
- Specified by:
newDefaultThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newDefaultScheduledThreadPool
public ScheduledExecutorService newDefaultScheduledThreadPool(Object source, String name)
- Specified by:
newDefaultScheduledThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThreadPool
public ExecutorService newThreadPool(Object source, String name, String profileId)
- Specified by:
newThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThreadPool
public ExecutorService newThreadPool(Object source, String name, org.apache.camel.spi.ThreadPoolProfile profile)
- Specified by:
newThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThreadPool
public ExecutorService newThreadPool(Object source, String name, int poolSize, int maxPoolSize)
- Specified by:
newThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newSingleThreadExecutor
public ExecutorService newSingleThreadExecutor(Object source, String name)
- Specified by:
newSingleThreadExecutorin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newCachedThreadPool
public ExecutorService newCachedThreadPool(Object source, String name)
- Specified by:
newCachedThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newFixedThreadPool
public ExecutorService newFixedThreadPool(Object source, String name, int poolSize)
- Specified by:
newFixedThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newSingleThreadScheduledExecutor
public ScheduledExecutorService newSingleThreadScheduledExecutor(Object source, String name)
- Specified by:
newSingleThreadScheduledExecutorin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newScheduledThreadPool
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, org.apache.camel.spi.ThreadPoolProfile profile)
- Specified by:
newScheduledThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newScheduledThreadPool
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, String profileId)
- Specified by:
newScheduledThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newScheduledThreadPool
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, int poolSize)
- Specified by:
newScheduledThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdown
public void shutdown(ExecutorService executorService)
- Specified by:
shutdownin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownGraceful
public void shutdownGraceful(ExecutorService executorService)
- Specified by:
shutdownGracefulin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownGraceful
public void shutdownGraceful(ExecutorService executorService, long shutdownAwaitTermination)
- Specified by:
shutdownGracefulin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownNow
public List<Runnable> shutdownNow(ExecutorService executorService)
- Specified by:
shutdownNowin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
awaitTermination
public boolean awaitTermination(ExecutorService executorService, long shutdownAwaitTermination) throws InterruptedException
- Specified by:
awaitTerminationin interfaceorg.apache.camel.spi.ExecutorServiceManager- Throws:
InterruptedException
-
onNewExecutorService
protected void onNewExecutorService(ExecutorService executorService)
Strategy callback when a newExecutorServicehave been created.- Parameters:
executorService- the createdExecutorService
-
doInit
protected void doInit() throws Exception- Overrides:
doInitin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doShutdown
protected void doShutdown() throws Exception- Overrides:
doShutdownin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
createThreadFactory
protected ThreadFactory createThreadFactory(String name, boolean isDaemon)
-
-