de.esprit.netsuite.server.cpu

## Class AgentWorkerThreadPool

- java.lang.Object
- - java.util.concurrent.AbstractExecutorService
  - - java.util.concurrent.ThreadPoolExecutor
    - - de.esprit.netsuite.common.AbstractThreadPool
      - - de.esprit.netsuite.server.cpu.ServerThreadPool
        - - de.esprit.netsuite.server.cpu.AgentWorkerThreadPool

- All Implemented Interfaces:
    Dumpable, ServerObject, java.util.concurrent.Executor, java.util.concurrent.ExecutorService

      public class AgentWorkerThreadPool
      extends ServerThreadPool

  This ThreadPool is used to execute async agents which put CPU load on the server. This pool is limited because NOT too many agents of this type should run in parallel. If more agents than the core-pool size want to run they are just queued. If the queue is full, more threads are started until the max-pool size is reached. Any further agent will be rejected by receiving a ServerTooBusyException.
  Author:
    Rainer Buesch

- - ### 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`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgentWorkerThreadPool(ServerContext serverCtx)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `afterExecute(java.lang.Runnable r, java.lang.Throwable t)`
    `protected void` | `beforeExecute(java.lang.Thread t, java.lang.Runnable r)`
    `protected java.util.concurrent.ThreadFactory` | `createThreadFactory()`

    - ### Methods inherited from class de.esprit.netsuite.server.cpu.ServerThreadPool

      `getServerContext, getServerStatistic, sendErrorMail`

    - ### Methods inherited from class de.esprit.netsuite.common.AbstractThreadPool

      `toDumpString, toDumpString, toString, toString`

    - ### 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, wait, wait, wait`

- - ### Constructor Detail

    - #### AgentWorkerThreadPool

          public AgentWorkerThreadPool(ServerContext serverCtx)

  - ### Method Detail

    - #### afterExecute

          protected void afterExecute(java.lang.Runnable r,
                          java.lang.Throwable t)

      Overrides:
        `afterExecute` in class `AbstractThreadPool`

    - #### beforeExecute

          protected void beforeExecute(java.lang.Thread t,
                           java.lang.Runnable r)

      Overrides:
        `beforeExecute` in class `java.util.concurrent.ThreadPoolExecutor`

    - #### createThreadFactory

          protected java.util.concurrent.ThreadFactory createThreadFactory()

      Specified by:
        `createThreadFactory` in class `AbstractThreadPool`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.