public class ChainedThreadingProfile extends Object implements ThreadingProfile
ChainedThreadingProfile(ThreadingProfile)
will switch behaviour between dynamic and static chaining.
Note that within Spring, as far as I understand things, object creation is always ordered so that dependencies are correctly resolved. In that case, in a static scenario (or in a dynamic one that rebuilds the instances) dynamic and static behaviour should be identical.
Also, the "lazy" chaining is an optimisation - all hierarchies should be grounded in a final
default which is ImmutableThreadingProfile
and, as such, return reliable
values (lazy would be necessary if this is not the case, since we must avoid evaluating
incomplete delegates).
ThreadingProfile.WorkManagerFactory
DEFAULT_DO_THREADING, DEFAULT_MAX_BUFFER_SIZE, DEFAULT_MAX_THREAD_TTL, DEFAULT_MAX_THREADS_ACTIVE, DEFAULT_MAX_THREADS_IDLE, DEFAULT_POOL_EXHAUST_ACTION, DEFAULT_THREAD_WAIT_TIMEOUT, DEFAULT_THREADING_PROFILE, POOL_EXHAUSTED_ACTIONS, WHEN_EXHAUSTED_ABORT, WHEN_EXHAUSTED_DISCARD, WHEN_EXHAUSTED_DISCARD_OLDEST, WHEN_EXHAUSTED_RUN, WHEN_EXHAUSTED_WAIT
Constructor and Description |
---|
ChainedThreadingProfile()
Generate a mutable threading profile with fixed default values taken from
ThreadingProfile.DEFAULT_THREADING_PROFILE |
ChainedThreadingProfile(ThreadingProfile delegate)
Generate a mutable threading profile with dynamic default values taken from the
given delegate.
|
ChainedThreadingProfile(ThreadingProfile delegate,
boolean dynamic)
Generate a mutable threading profile.
|
public ChainedThreadingProfile()
ThreadingProfile.DEFAULT_THREADING_PROFILE
public ChainedThreadingProfile(ThreadingProfile delegate)
public ChainedThreadingProfile(ThreadingProfile delegate, boolean dynamic)
delegate
- Source of default values.dynamic
- If true, changes in delegate are reflected in this instancepublic int getMaxThreadsActive()
getMaxThreadsActive
in interface ThreadingProfile
public int getMaxThreadsIdle()
getMaxThreadsIdle
in interface ThreadingProfile
public long getThreadTTL()
getThreadTTL
in interface ThreadingProfile
public long getThreadWaitTimeout()
getThreadWaitTimeout
in interface ThreadingProfile
public int getPoolExhaustedAction()
getPoolExhaustedAction
in interface ThreadingProfile
public RejectedExecutionHandler getRejectedExecutionHandler()
getRejectedExecutionHandler
in interface ThreadingProfile
public ThreadFactory getThreadFactory()
getThreadFactory
in interface ThreadingProfile
public void setMaxThreadsActive(int maxThreadsActive)
setMaxThreadsActive
in interface ThreadingProfile
public void setMaxThreadsIdle(int maxThreadsIdle)
setMaxThreadsIdle
in interface ThreadingProfile
public void setThreadTTL(long threadTTL)
setThreadTTL
in interface ThreadingProfile
public void setThreadWaitTimeout(long threadWaitTimeout)
setThreadWaitTimeout
in interface ThreadingProfile
public void setPoolExhaustedAction(int poolExhaustPolicy)
setPoolExhaustedAction
in interface ThreadingProfile
public void setRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler)
setRejectedExecutionHandler
in interface ThreadingProfile
public void setThreadFactory(ThreadFactory threadFactory)
setThreadFactory
in interface ThreadingProfile
public int getMaxBufferSize()
getMaxBufferSize
in interface ThreadingProfile
public void setMaxBufferSize(int maxBufferSize)
setMaxBufferSize
in interface ThreadingProfile
public ThreadingProfile.WorkManagerFactory getWorkManagerFactory()
getWorkManagerFactory
in interface ThreadingProfile
public void setWorkManagerFactory(ThreadingProfile.WorkManagerFactory workManagerFactory)
setWorkManagerFactory
in interface ThreadingProfile
public WorkManager createWorkManager(String name, int shutdownTimeout)
createWorkManager
in interface ThreadingProfile
public ExecutorService createPool()
createPool
in interface ThreadingProfile
public ExecutorService createPool(String name)
createPool
in interface ThreadingProfile
public boolean isDoThreading()
isDoThreading
in interface ThreadingProfile
public void setDoThreading(boolean doThreading)
setDoThreading
in interface ThreadingProfile
public ThreadPoolFactory getPoolFactory()
getPoolFactory
in interface ThreadingProfile
public ScheduledExecutorService createScheduledPool(String name)
createScheduledPool
in interface ThreadingProfile
public MuleContext getMuleContext()
getMuleContext
in interface ThreadingProfile
public void setMuleContext(MuleContext muleContext)
setMuleContext
in interface MuleContextAware
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.