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.ExecutorServiceManager
BaseExecutorServiceManager
which 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 boolean
awaitTermination(ExecutorService executorService, long shutdownAwaitTermination)
protected ThreadFactory
createThreadFactory(String name, boolean isDaemon)
protected void
doInit()
protected void
doShutdown()
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 newExecutorService
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)
-
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:
getThreadPoolFactory
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
setThreadPoolFactory
public void setThreadPoolFactory(org.apache.camel.spi.ThreadPoolFactory threadPoolFactory)
- Specified by:
setThreadPoolFactory
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
registerThreadPoolProfile
public void registerThreadPoolProfile(org.apache.camel.spi.ThreadPoolProfile profile)
- Specified by:
registerThreadPoolProfile
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
getThreadPoolProfile
public org.apache.camel.spi.ThreadPoolProfile getThreadPoolProfile(String id)
- Specified by:
getThreadPoolProfile
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
getDefaultThreadPoolProfile
public org.apache.camel.spi.ThreadPoolProfile getDefaultThreadPoolProfile()
- Specified by:
getDefaultThreadPoolProfile
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
setDefaultThreadPoolProfile
public void setDefaultThreadPoolProfile(org.apache.camel.spi.ThreadPoolProfile defaultThreadPoolProfile)
- Specified by:
setDefaultThreadPoolProfile
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
getThreadNamePattern
public String getThreadNamePattern()
- Specified by:
getThreadNamePattern
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
setThreadNamePattern
public void setThreadNamePattern(String threadNamePattern)
- Specified by:
setThreadNamePattern
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
getShutdownAwaitTermination
public long getShutdownAwaitTermination()
- Specified by:
getShutdownAwaitTermination
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
setShutdownAwaitTermination
public void setShutdownAwaitTermination(long shutdownAwaitTermination)
- Specified by:
setShutdownAwaitTermination
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
resolveThreadName
public String resolveThreadName(String name)
- Specified by:
resolveThreadName
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThread
public Thread newThread(String name, Runnable runnable)
- Specified by:
newThread
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newDefaultThreadPool
public ExecutorService newDefaultThreadPool(Object source, String name)
- Specified by:
newDefaultThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newDefaultScheduledThreadPool
public ScheduledExecutorService newDefaultScheduledThreadPool(Object source, String name)
- Specified by:
newDefaultScheduledThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThreadPool
public ExecutorService newThreadPool(Object source, String name, String profileId)
- Specified by:
newThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThreadPool
public ExecutorService newThreadPool(Object source, String name, org.apache.camel.spi.ThreadPoolProfile profile)
- Specified by:
newThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThreadPool
public ExecutorService newThreadPool(Object source, String name, int poolSize, int maxPoolSize)
- Specified by:
newThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newSingleThreadExecutor
public ExecutorService newSingleThreadExecutor(Object source, String name)
- Specified by:
newSingleThreadExecutor
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newCachedThreadPool
public ExecutorService newCachedThreadPool(Object source, String name)
- Specified by:
newCachedThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newFixedThreadPool
public ExecutorService newFixedThreadPool(Object source, String name, int poolSize)
- Specified by:
newFixedThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newSingleThreadScheduledExecutor
public ScheduledExecutorService newSingleThreadScheduledExecutor(Object source, String name)
- Specified by:
newSingleThreadScheduledExecutor
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newScheduledThreadPool
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, org.apache.camel.spi.ThreadPoolProfile profile)
- Specified by:
newScheduledThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newScheduledThreadPool
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, String profileId)
- Specified by:
newScheduledThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newScheduledThreadPool
public ScheduledExecutorService newScheduledThreadPool(Object source, String name, int poolSize)
- Specified by:
newScheduledThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdown
public void shutdown(ExecutorService executorService)
- Specified by:
shutdown
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownGraceful
public void shutdownGraceful(ExecutorService executorService)
- Specified by:
shutdownGraceful
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownGraceful
public void shutdownGraceful(ExecutorService executorService, long shutdownAwaitTermination)
- Specified by:
shutdownGraceful
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownNow
public List<Runnable> shutdownNow(ExecutorService executorService)
- Specified by:
shutdownNow
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
awaitTermination
public boolean awaitTermination(ExecutorService executorService, long shutdownAwaitTermination) throws InterruptedException
- Specified by:
awaitTermination
in interfaceorg.apache.camel.spi.ExecutorServiceManager
- Throws:
InterruptedException
-
onNewExecutorService
protected void onNewExecutorService(ExecutorService executorService)
Strategy callback when a newExecutorService
have been created.- Parameters:
executorService
- the createdExecutorService
-
doInit
protected void doInit() throws Exception
- Overrides:
doInit
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doShutdown
protected void doShutdown() throws Exception
- Overrides:
doShutdown
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
createThreadFactory
protected ThreadFactory createThreadFactory(String name, boolean isDaemon)
-
-