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
- Direct Known Subclasses:
DefaultExecutorServiceManager
public class BaseExecutorServiceManager
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.ExecutorServiceManager
Base
ExecutorServiceManager which can be used for implementations-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.camel.spi.ExecutorServiceManager
org.apache.camel.spi.ExecutorServiceManager.ThreadFactoryListener -
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddThreadFactoryListener(org.apache.camel.spi.ExecutorServiceManager.ThreadFactoryListener threadFactoryListener) booleanawaitTermination(ExecutorService executorService, long shutdownAwaitTermination) protected ThreadFactorycreateThreadFactory(String name, boolean daemon) protected voiddoInit()protected voidprotected voiddoStart()org.apache.camel.CamelContextorg.apache.camel.spi.ThreadPoolProfilelongorg.apache.camel.spi.ThreadPoolFactoryorg.apache.camel.spi.ThreadPoolProfilenewCachedThreadPool(Object source, String name) newDefaultScheduledThreadPool(Object source, String name) newDefaultThreadPool(Object source, String name) newFixedThreadPool(Object source, String name, int poolSize) newScheduledThreadPool(Object source, String name, int poolSize) newScheduledThreadPool(Object source, String name, String profileId) newScheduledThreadPool(Object source, String name, org.apache.camel.spi.ThreadPoolProfile profile) newSingleThreadExecutor(Object source, String name) newSingleThreadScheduledExecutor(Object source, String name) newThreadPool(Object source, String name, int poolSize, int maxPoolSize) newThreadPool(Object source, String name, String profileId) newThreadPool(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) resolveThreadName(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) shutdownNow(ExecutorService executorService) Methods inherited from class org.apache.camel.support.service.BaseService
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, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
BaseExecutorServiceManager
public BaseExecutorServiceManager(org.apache.camel.CamelContext camelContext)
-
-
Method Details
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext() -
addThreadFactoryListener
public void addThreadFactoryListener(org.apache.camel.spi.ExecutorServiceManager.ThreadFactoryListener threadFactoryListener) - Specified by:
addThreadFactoryListenerin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
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
- 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
- Specified by:
getThreadNamePatternin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
setThreadNamePattern
- 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
- Specified by:
resolveThreadNamein interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThread
- Specified by:
newThreadin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newDefaultThreadPool
- Specified by:
newDefaultThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newDefaultScheduledThreadPool
- Specified by:
newDefaultScheduledThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThreadPool
- 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
- Specified by:
newThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newSingleThreadExecutor
- Specified by:
newSingleThreadExecutorin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newCachedThreadPool
- Specified by:
newCachedThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newFixedThreadPool
- Specified by:
newFixedThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newSingleThreadScheduledExecutor
- 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
- Specified by:
newScheduledThreadPoolin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdown
- Specified by:
shutdownin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownGraceful
- Specified by:
shutdownGracefulin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownGraceful
- Specified by:
shutdownGracefulin interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownNow
- 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
Strategy callback when a newExecutorServicehave been created.- Parameters:
executorService- the createdExecutorService
-
doInit
- Overrides:
doInitin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStart
- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doShutdown
- Overrides:
doShutdownin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
createThreadFactory
-