org.mule.api.config
Interface ThreadingProfile

All Superinterfaces:
MuleContextAware
All Known Implementing Classes:
ChainedThreadingProfile, ImmutableThreadingProfile, MutableThreadingProfile

public interface ThreadingProfile
extends MuleContextAware

Mule uses a few different pools i.e. for service threads and message dispatchers. This interface makes it easier to configure the pool. Pools are created via ImmutableThreadingProfile.createPool(String) (which should really be a separate factory).

ImmutableThreadingProfile is a simple read-only implementation that makes a local copy of any ThreadingProfile instance passed to a constructor.

ChainedThreadingProfile is a mutable implementation that can take default values from an existing ThreadingProfile. The default values can be either dynamic (read whenever the value is queried) or static (a local copy of the default is made when the profile is first constructed).


Nested Class Summary
static interface ThreadingProfile.WorkManagerFactory
           
 
Field Summary
static boolean DEFAULT_DO_THREADING
          Default value for do threading
static int DEFAULT_MAX_BUFFER_SIZE
          Default value for MAX_BUFFER_SIZE
static long DEFAULT_MAX_THREAD_TTL
          Default value for MAX_THREAD_TTL
static int DEFAULT_MAX_THREADS_ACTIVE
          Default value for MAX_THREADS_ACTIVE
static int DEFAULT_MAX_THREADS_IDLE
          Default value for MAX_THREADS_IDLE
static int DEFAULT_POOL_EXHAUST_ACTION
          Default action to perform on pool exhaustion
static long DEFAULT_THREAD_WAIT_TIMEOUT
          Default value for DEFAULT_THREAD_WAIT_TIMEOUT
static ThreadingProfile DEFAULT_THREADING_PROFILE
           
static Map<?,?> POOL_EXHAUSTED_ACTIONS
           
static int WHEN_EXHAUSTED_ABORT
           
static int WHEN_EXHAUSTED_DISCARD
           
static int WHEN_EXHAUSTED_DISCARD_OLDEST
           
static int WHEN_EXHAUSTED_RUN
           
static int WHEN_EXHAUSTED_WAIT
          Actions to perform on pool exhaustion
 
Method Summary
 ExecutorService createPool()
           
 ExecutorService createPool(String name)
           
 ScheduledExecutorService createScheduledPool(String name)
           
 WorkManager createWorkManager(String name, int shutdownTimeout)
           
 int getMaxBufferSize()
           
 int getMaxThreadsActive()
           
 int getMaxThreadsIdle()
           
 MuleContext getMuleContext()
           
 int getPoolExhaustedAction()
           
 ThreadPoolFactory getPoolFactory()
           
 RejectedExecutionHandler getRejectedExecutionHandler()
           
 ThreadFactory getThreadFactory()
           
 long getThreadTTL()
           
 long getThreadWaitTimeout()
           
 ThreadingProfile.WorkManagerFactory getWorkManagerFactory()
           
 boolean isDoThreading()
           
 void setDoThreading(boolean doThreading)
           
 void setMaxBufferSize(int maxBufferSize)
           
 void setMaxThreadsActive(int maxThreadsActive)
           
 void setMaxThreadsIdle(int maxThreadsIdle)
           
 void setPoolExhaustedAction(int poolExhaustPolicy)
           
 void setRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler)
           
 void setThreadFactory(ThreadFactory threadFactory)
           
 void setThreadTTL(long threadTTL)
           
 void setThreadWaitTimeout(long threadWaitTimeout)
           
 void setWorkManagerFactory(ThreadingProfile.WorkManagerFactory workManagerFactory)
           
 
Methods inherited from interface org.mule.api.context.MuleContextAware
setMuleContext
 

Field Detail

DEFAULT_MAX_THREADS_ACTIVE

static final int DEFAULT_MAX_THREADS_ACTIVE
Default value for MAX_THREADS_ACTIVE

See Also:
Constant Field Values

DEFAULT_MAX_THREADS_IDLE

static final int DEFAULT_MAX_THREADS_IDLE
Default value for MAX_THREADS_IDLE

See Also:
Constant Field Values

DEFAULT_MAX_BUFFER_SIZE

static final int DEFAULT_MAX_BUFFER_SIZE
Default value for MAX_BUFFER_SIZE

See Also:
Constant Field Values

DEFAULT_MAX_THREAD_TTL

static final long DEFAULT_MAX_THREAD_TTL
Default value for MAX_THREAD_TTL

See Also:
Constant Field Values

DEFAULT_THREAD_WAIT_TIMEOUT

static final long DEFAULT_THREAD_WAIT_TIMEOUT
Default value for DEFAULT_THREAD_WAIT_TIMEOUT

See Also:
Constant Field Values

DEFAULT_DO_THREADING

static final boolean DEFAULT_DO_THREADING
Default value for do threading

See Also:
Constant Field Values

WHEN_EXHAUSTED_WAIT

static final int WHEN_EXHAUSTED_WAIT
Actions to perform on pool exhaustion

See Also:
Constant Field Values

WHEN_EXHAUSTED_DISCARD

static final int WHEN_EXHAUSTED_DISCARD
See Also:
Constant Field Values

WHEN_EXHAUSTED_DISCARD_OLDEST

static final int WHEN_EXHAUSTED_DISCARD_OLDEST
See Also:
Constant Field Values

WHEN_EXHAUSTED_ABORT

static final int WHEN_EXHAUSTED_ABORT
See Also:
Constant Field Values

WHEN_EXHAUSTED_RUN

static final int WHEN_EXHAUSTED_RUN
See Also:
Constant Field Values

DEFAULT_POOL_EXHAUST_ACTION

static final int DEFAULT_POOL_EXHAUST_ACTION
Default action to perform on pool exhaustion

See Also:
Constant Field Values

POOL_EXHAUSTED_ACTIONS

static final Map<?,?> POOL_EXHAUSTED_ACTIONS

DEFAULT_THREADING_PROFILE

static final ThreadingProfile DEFAULT_THREADING_PROFILE
Method Detail

getMaxThreadsActive

int getMaxThreadsActive()

getMaxThreadsIdle

int getMaxThreadsIdle()

getThreadTTL

long getThreadTTL()

getThreadWaitTimeout

long getThreadWaitTimeout()

getPoolExhaustedAction

int getPoolExhaustedAction()

getRejectedExecutionHandler

RejectedExecutionHandler getRejectedExecutionHandler()

getThreadFactory

ThreadFactory getThreadFactory()

setMaxThreadsActive

void setMaxThreadsActive(int maxThreadsActive)

setMaxThreadsIdle

void setMaxThreadsIdle(int maxThreadsIdle)

setThreadTTL

void setThreadTTL(long threadTTL)

setThreadWaitTimeout

void setThreadWaitTimeout(long threadWaitTimeout)

setPoolExhaustedAction

void setPoolExhaustedAction(int poolExhaustPolicy)

setRejectedExecutionHandler

void setRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler)

setThreadFactory

void setThreadFactory(ThreadFactory threadFactory)

getMaxBufferSize

int getMaxBufferSize()

setMaxBufferSize

void setMaxBufferSize(int maxBufferSize)

getWorkManagerFactory

ThreadingProfile.WorkManagerFactory getWorkManagerFactory()

setWorkManagerFactory

void setWorkManagerFactory(ThreadingProfile.WorkManagerFactory workManagerFactory)

createWorkManager

WorkManager createWorkManager(String name,
                              int shutdownTimeout)

createPool

ExecutorService createPool()

createPool

ExecutorService createPool(String name)

isDoThreading

boolean isDoThreading()

setDoThreading

void setDoThreading(boolean doThreading)

getPoolFactory

ThreadPoolFactory getPoolFactory()

createScheduledPool

ScheduledExecutorService createScheduledPool(String name)

getMuleContext

MuleContext getMuleContext()


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.