org.apache.synapse.util.concurrent
Class SynapseThreadPool

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by org.apache.synapse.util.concurrent.SynapseThreadPool
All Implemented Interfaces:
Executor, ExecutorService

public class SynapseThreadPool
extends ThreadPoolExecutor

This is the executor service that will be returned by the env


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
 
Field Summary
static String SYN_THREAD_ALIVE
           
static String SYN_THREAD_CORE
           
static String SYN_THREAD_GROUP
           
static String SYN_THREAD_IDPREFIX
           
static String SYN_THREAD_MAX
           
static String SYN_THREAD_QLEN
           
static int SYNAPSE_CORE_THREADS
           
static int SYNAPSE_KEEP_ALIVE
           
static int SYNAPSE_MAX_THREADS
           
static String SYNAPSE_THREAD_GROUP
           
static String SYNAPSE_THREAD_ID_PREFIX
           
static int SYNAPSE_THREAD_QLEN
           
 
Constructor Summary
SynapseThreadPool()
          Default Constructor for the thread pool and will use all the values as default
SynapseThreadPool(int corePoolSize, int maxPoolSize, long keepAliveTime, int qlen, String threadGroup, String threadIdPrefix)
          Constructor for the SynapseThreadPool
SynapseThreadPool(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue)
          Constructor for the Synapse thread poll
 
Method Summary
 
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated
 
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYNAPSE_CORE_THREADS

public static final int SYNAPSE_CORE_THREADS
See Also:
Constant Field Values

SYNAPSE_MAX_THREADS

public static final int SYNAPSE_MAX_THREADS
See Also:
Constant Field Values

SYNAPSE_KEEP_ALIVE

public static final int SYNAPSE_KEEP_ALIVE
See Also:
Constant Field Values

SYNAPSE_THREAD_QLEN

public static final int SYNAPSE_THREAD_QLEN
See Also:
Constant Field Values

SYNAPSE_THREAD_GROUP

public static final String SYNAPSE_THREAD_GROUP
See Also:
Constant Field Values

SYNAPSE_THREAD_ID_PREFIX

public static final String SYNAPSE_THREAD_ID_PREFIX
See Also:
Constant Field Values

SYN_THREAD_CORE

public static final String SYN_THREAD_CORE
See Also:
Constant Field Values

SYN_THREAD_MAX

public static final String SYN_THREAD_MAX
See Also:
Constant Field Values

SYN_THREAD_ALIVE

public static final String SYN_THREAD_ALIVE
See Also:
Constant Field Values

SYN_THREAD_QLEN

public static final String SYN_THREAD_QLEN
See Also:
Constant Field Values

SYN_THREAD_GROUP

public static final String SYN_THREAD_GROUP
See Also:
Constant Field Values

SYN_THREAD_IDPREFIX

public static final String SYN_THREAD_IDPREFIX
See Also:
Constant Field Values
Constructor Detail

SynapseThreadPool

public SynapseThreadPool(int corePoolSize,
                         int maximumPoolSize,
                         long keepAliveTime,
                         TimeUnit unit,
                         BlockingQueue<Runnable> workQueue)
Constructor for the Synapse thread poll

Parameters:
corePoolSize - - number of threads to keep in the pool, even if they are idle
maximumPoolSize - - the maximum number of threads to allow in the pool
keepAliveTime - - this is the maximum time that excess idle threads will wait for new tasks before terminating.
unit - - the time unit for the keepAliveTime argument.
workQueue - - the queue to use for holding tasks before they are executed.

SynapseThreadPool

public SynapseThreadPool()
Default Constructor for the thread pool and will use all the values as default


SynapseThreadPool

public SynapseThreadPool(int corePoolSize,
                         int maxPoolSize,
                         long keepAliveTime,
                         int qlen,
                         String threadGroup,
                         String threadIdPrefix)
Constructor for the SynapseThreadPool

Parameters:
corePoolSize - - number of threads to keep in the pool, even if they are idle
maxPoolSize - - the maximum number of threads to allow in the pool
keepAliveTime - - this is the maximum time that excess idle threads will wait for new tasks before terminating.
qlen - - Thread Blocking Queue length
threadGroup - - ThreadGroup name
threadIdPrefix - - Thread id prefix


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.