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-
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 TypeMethodDescriptionboolean
awaitTermination
(ExecutorService executorService, long shutdownAwaitTermination) protected ThreadFactory
createThreadFactory
(String name, boolean isDaemon) protected void
doInit()
protected void
protected void
doStart()
org.apache.camel.CamelContext
org.apache.camel.spi.ThreadPoolProfile
long
org.apache.camel.spi.ThreadPoolFactory
org.apache.camel.spi.ThreadPoolProfile
newCachedThreadPool
(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 void
onNewExecutorService
(ExecutorService executorService) Strategy callback when a newExecutorService
have been created.void
registerThreadPoolProfile
(org.apache.camel.spi.ThreadPoolProfile profile) 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) 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, suspend
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods 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() -
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
- 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
- Specified by:
getThreadNamePattern
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
setThreadNamePattern
- 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
- Specified by:
resolveThreadName
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThread
- Specified by:
newThread
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newDefaultThreadPool
- Specified by:
newDefaultThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newDefaultScheduledThreadPool
- Specified by:
newDefaultScheduledThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newThreadPool
- 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
- Specified by:
newThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newSingleThreadExecutor
- Specified by:
newSingleThreadExecutor
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newCachedThreadPool
- Specified by:
newCachedThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newFixedThreadPool
- Specified by:
newFixedThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
newSingleThreadScheduledExecutor
- 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
- Specified by:
newScheduledThreadPool
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdown
- Specified by:
shutdown
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownGraceful
- Specified by:
shutdownGraceful
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownGraceful
- Specified by:
shutdownGraceful
in interfaceorg.apache.camel.spi.ExecutorServiceManager
-
shutdownNow
- 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
Strategy callback when a newExecutorService
have been created.- Parameters:
executorService
- the createdExecutorService
-
doInit
- Overrides:
doInit
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStart
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doShutdown
- Overrides:
doShutdown
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
createThreadFactory
-