DESY ACOP Beans Home

com.cosylab.util
Class ThreadPool

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by com.cosylab.util.ThreadPool
All Implemented Interfaces:
java.util.concurrent.Executor, java.util.concurrent.ExecutorService

Deprecated. This implementation has been replaced by java.util.concurent package

public class ThreadPool
extends java.util.concurrent.ThreadPoolExecutor

A default implementation of thread pool which delegates to Java concurrent library. It creates worker threads with Thread.NORM_PRIORITY - 2. A maximum number of workers can be active concurrently, specifiable by the maximumPoolSize property. If execute() is called and no worker is free, the call will block until one of the workers terminate. Use this service to execute short tasks. In this way excessive construction of new thread instances can be prevented, speeding up the application.

Version:
$id$
Author:
Gasper Tkacik

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
ThreadPool()
          Deprecated. Constructs a executor with 25 active threads.
ThreadPool(int priority)
          Deprecated. Creates a new ThreadPool object.
 
Method Summary
 void destroy()
          Deprecated. Releases the thread pool.
 java.lang.ThreadGroup getGroup()
          Deprecated. Returns the thread group to which all worker threads of this service belong.
 java.lang.String toString()
          Deprecated. Returns a short summary of this instance.
 
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, 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, newTaskFor, newTaskFor, submit, submit, submit
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadPool

public ThreadPool()
Deprecated. 
Constructs a executor with 25 active threads.


ThreadPool

public ThreadPool(int priority)
Deprecated. 
Creates a new ThreadPool object.

Parameters:
priority - the priority of worker threads.
Method Detail

getGroup

public java.lang.ThreadGroup getGroup()
Deprecated. 
Returns the thread group to which all worker threads of this service belong. This will return non-null after this component has been initialized.

Returns:
the group of all worker threads

destroy

public void destroy()
Deprecated. 
Releases the thread pool. First attempts to wait until the tasks have executed. New tasks are not accepted. Then, if after the period WAIT_FOR_SHUTDOWN the threads do not complete, the pool is forcibly terminated.


toString

public java.lang.String toString()
Deprecated. 
Returns a short summary of this instance.

Overrides:
toString in class java.lang.Object
Returns:
internal state of this


Copyright © 2010. All Rights Reserved.