|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.n52.wps.server.handler.RequestExecutor
public class RequestExecutor
After the client Request is accepted, it should be executed. To prevent resource-exhaustion, this ThreadPoolExecutor stores the Requests in a queue, and handles only a couple of them at a time. To tune the performance one can alter the parameters of this pool. Proper pool size estimation: N = Number of processors WT = Average waiting time of a task ST = Average service time of a task #Threads = N * (1 + WT/ST)
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor |
|---|
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy |
| Field Summary | |
|---|---|
static int |
KEEP_ALIVE_SECONDS
|
static int |
MAX_POOL_SIZE
|
static int |
MAX_QUEUED_TASKS
|
static int |
MIN_POOL_SIZE
|
| Constructor Summary | |
|---|---|
RequestExecutor()
Create a RequestExecutor. |
|
| Method Summary | |
|---|---|
protected void |
afterExecute(java.lang.Runnable r,
java.lang.Throwable t)
After Execution of the Request this method is called. |
protected void |
beforeExecute(java.lang.Thread t,
java.lang.Runnable r)
Before Executing the Request this method is called. |
| Methods inherited from class java.util.concurrent.ThreadPoolExecutor |
|---|
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, 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, newTaskFor, newTaskFor, submit, submit, submit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MIN_POOL_SIZE
public static final int MAX_POOL_SIZE
public static final int KEEP_ALIVE_SECONDS
public static final int MAX_QUEUED_TASKS
| Constructor Detail |
|---|
public RequestExecutor()
| Method Detail |
|---|
protected void beforeExecute(java.lang.Thread t,
java.lang.Runnable r)
beforeExecute in class java.util.concurrent.ThreadPoolExecutort - The Thread which executes the Request.r - The Request.ThreadPoolExecutor.beforeExecute(java.lang.Thread,
java.lang.Runnable)
protected void afterExecute(java.lang.Runnable r,
java.lang.Throwable t)
afterExecute in class java.util.concurrent.ThreadPoolExecutorr - The Request.t - The Exception that was thrown (if one exists, otherwise null).ThreadPoolExecutor.afterExecute(java.lang.Runnable,
java.lang.Throwable)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||