Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.axis2.util.threadpool
Class ThreadPool

    java.lang.Object
      org.apache.axis2.util.threadpool.ThreadPool

All Implemented Interfaces:
  ThreadFactory

    public class ThreadPool

extends java.lang.Object
implements ThreadFactory

This the thread pool for axis2. This class will be used a singleton across axis2 engine. `ThreadPool` is accepts `AxisWorkers` which has run method on them and execute this method, using one of the threads in the thread pool.

Field Summary
`protected java.util.concurrent.ThreadPoolExecutor` | `executor`
`protected static long` | `SLEEP_INTERVAL`

Constructor Summary
`ThreadPool()`
`ThreadPool(int corePoolSize, int maxPoolSize)`

Method Summary
`protected java.util.concurrent.ThreadPoolExecutor` | `createDefaultExecutor(java.lang.String name, int priority, boolean daemon)`
`void` | `execute(java.lang.Runnable worker)`
`void` | `forceShutDown()` A forceful shutdown mechanism for thread pool.
`java.util.concurrent.Executor` | `getExecutor()`
`void` | `safeShutDown()` This is the recommended shutdown method for the thread pool This will wait till all the workers that are already handed over to the thread pool get executed.
`void` | `setExecutor(java.util.concurrent.ThreadPoolExecutor executor)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SLEEP_INTERVAL

    protected static long SLEEP_INTERVAL

### executor

    protected java.util.concurrent.ThreadPoolExecutor executor

Constructor Detail

### ThreadPool

    public ThreadPool()

### ThreadPool

    public ThreadPool(int corePoolSize,
                      int maxPoolSize)

Method Detail

### getExecutor

    public java.util.concurrent.Executor getExecutor()

### setExecutor

    public void setExecutor(java.util.concurrent.ThreadPoolExecutor executor)

### execute

    public void execute(java.lang.Runnable worker)

  Specified by:
    `execute` in interface `ThreadFactory`

### forceShutDown

    public void forceShutDown()

  A forceful shutdown mechanism for thread pool.

### safeShutDown

    public void safeShutDown()
                      throws AxisFault

  This is the recommended shutdown method for the thread pool This will wait till all the workers that are already handed over to the thread pool get executed.

  Throws:
    `AxisFault`

### createDefaultExecutor

    protected java.util.concurrent.ThreadPoolExecutor createDefaultExecutor(java.lang.String name,
                                                                            int priority,
                                                                            boolean daemon)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.