org.mule.config
Class ThreadingProfile

java.lang.Object
  extended by org.mule.config.ThreadingProfile

public class ThreadingProfile
extends Object

ThreadingProfile is used to configure a thread pool. Mule uses a few different pools i.e. for component threads and message dispatchers. This object makes it easier to configure the pool.


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 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
 
Constructor Summary
ThreadingProfile()
           
ThreadingProfile(int maxThreadsActive, int maxThreadsIdle, long threadTTL, int poolExhaustPolicy, RejectedExecutionHandler rejectedExecutionHandler, ThreadFactory threadFactory)
           
ThreadingProfile(ThreadingProfile tp)
           
 
Method Summary
 ThreadPoolExecutor createPool()
           
 ThreadPoolExecutor createPool(String name)
           
 UMOWorkManager createWorkManager(String name)
           
 int getMaxBufferSize()
           
 int getMaxThreadsActive()
           
 int getMaxThreadsIdle()
           
 int getPoolExhaustedAction()
           
 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 setPoolExhaustedActionString(String poolExhaustPolicy)
           
 void setRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler)
           
 void setThreadFactory(ThreadFactory threadFactory)
           
 void setThreadTTL(long threadTTL)
           
 void setThreadWaitTimeout(long threadWaitTimeout)
           
 void setWorkManagerFactory(ThreadingProfile.WorkManagerFactory workManagerFactory)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MAX_THREADS_ACTIVE

public static final int DEFAULT_MAX_THREADS_ACTIVE
Default value for MAX_THREADS_ACTIVE

See Also:
Constant Field Values

DEFAULT_MAX_THREADS_IDLE

public static final int DEFAULT_MAX_THREADS_IDLE
Default value for MAX_THREADS_IDLE

See Also:
Constant Field Values

DEFAULT_MAX_BUFFER_SIZE

public static final int DEFAULT_MAX_BUFFER_SIZE
Default value for MAX_BUFFER_SIZE

See Also:
Constant Field Values

DEFAULT_MAX_THREAD_TTL

public static final long DEFAULT_MAX_THREAD_TTL
Default value for MAX_THREAD_TTL

See Also:
Constant Field Values

DEFAULT_THREAD_WAIT_TIMEOUT

public static final long DEFAULT_THREAD_WAIT_TIMEOUT
Default value for DEFAULT_THREAD_WAIT_TIMEOUT

See Also:
Constant Field Values

DEFAULT_DO_THREADING

public static final boolean DEFAULT_DO_THREADING
Default value for do threading

See Also:
Constant Field Values

WHEN_EXHAUSTED_WAIT

public static final int WHEN_EXHAUSTED_WAIT
Actions to perform on pool exhaustion

See Also:
Constant Field Values

WHEN_EXHAUSTED_DISCARD

public static final int WHEN_EXHAUSTED_DISCARD
See Also:
Constant Field Values

WHEN_EXHAUSTED_DISCARD_OLDEST

public static final int WHEN_EXHAUSTED_DISCARD_OLDEST
See Also:
Constant Field Values

WHEN_EXHAUSTED_ABORT

public static final int WHEN_EXHAUSTED_ABORT
See Also:
Constant Field Values

WHEN_EXHAUSTED_RUN

public static final int WHEN_EXHAUSTED_RUN
See Also:
Constant Field Values

DEFAULT_POOL_EXHAUST_ACTION

public static final int DEFAULT_POOL_EXHAUST_ACTION
Default action to perform on pool exhaustion

See Also:
Constant Field Values
Constructor Detail

ThreadingProfile

public ThreadingProfile()

ThreadingProfile

public ThreadingProfile(int maxThreadsActive,
                        int maxThreadsIdle,
                        long threadTTL,
                        int poolExhaustPolicy,
                        RejectedExecutionHandler rejectedExecutionHandler,
                        ThreadFactory threadFactory)

ThreadingProfile

public ThreadingProfile(ThreadingProfile tp)
Method Detail

getMaxThreadsActive

public int getMaxThreadsActive()

getMaxThreadsIdle

public int getMaxThreadsIdle()

getThreadTTL

public long getThreadTTL()

getThreadWaitTimeout

public long getThreadWaitTimeout()

getPoolExhaustedAction

public int getPoolExhaustedAction()

getRejectedExecutionHandler

public RejectedExecutionHandler getRejectedExecutionHandler()

getThreadFactory

public ThreadFactory getThreadFactory()

setMaxThreadsActive

public void setMaxThreadsActive(int maxThreadsActive)

setMaxThreadsIdle

public void setMaxThreadsIdle(int maxThreadsIdle)

setThreadTTL

public void setThreadTTL(long threadTTL)

setThreadWaitTimeout

public void setThreadWaitTimeout(long threadWaitTimeout)

setPoolExhaustedAction

public void setPoolExhaustedAction(int poolExhaustPolicy)

setPoolExhaustedActionString

public void setPoolExhaustedActionString(String poolExhaustPolicy)

setRejectedExecutionHandler

public void setRejectedExecutionHandler(RejectedExecutionHandler rejectedExecutionHandler)

setThreadFactory

public void setThreadFactory(ThreadFactory threadFactory)

getMaxBufferSize

public int getMaxBufferSize()

setMaxBufferSize

public void setMaxBufferSize(int maxBufferSize)

getWorkManagerFactory

public ThreadingProfile.WorkManagerFactory getWorkManagerFactory()

setWorkManagerFactory

public void setWorkManagerFactory(ThreadingProfile.WorkManagerFactory workManagerFactory)

createWorkManager

public UMOWorkManager createWorkManager(String name)

createPool

public ThreadPoolExecutor createPool()

createPool

public ThreadPoolExecutor createPool(String name)

isDoThreading

public boolean isDoThreading()

setDoThreading

public void setDoThreading(boolean doThreading)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.