Classes | Public Member Functions | Package Functions | Private Member Functions | Private Attributes
org.apache.xmlrpc.util.ThreadPool Class Reference

List of all members.

Classes

interface  InterruptableTask
class  Poolable
interface  Task

Public Member Functions

boolean addTask (Task pTask)
int getMaxThreads ()
synchronized int getNumThreads ()
synchronized void shutdown ()
boolean startTask (Task pTask)
 ThreadPool (int pMaxSize, String pName)

Package Functions

void repool (Poolable pPoolable)

Private Member Functions

synchronized Poolable getPoolable (Task pTask, boolean pQueue)
synchronized void remove (Poolable pPoolable)

Private Attributes

final int maxSize
int num
final List runningThreads = new ArrayList()
final ThreadGroup threadGroup
final List waitingTasks = new ArrayList()
final List waitingThreads = new ArrayList()

Detailed Description

Simple thread pool. A task is executed by obtaining a thread from the pool

Definition at line 28 of file ThreadPool.java.


Constructor & Destructor Documentation

org.apache.xmlrpc.util.ThreadPool.ThreadPool ( int  pMaxSize,
String  pName 
) [inline]

Creates a new instance.

Parameters:
pMaxSizeMaximum number of concurrent threads.
pNameThread group name.

Definition at line 123 of file ThreadPool.java.


Member Function Documentation

boolean org.apache.xmlrpc.util.ThreadPool.addTask ( Task  pTask) [inline]

Adds a task for immediate or deferred execution.

Parameters:
pTaskThe task being added.
Returns:
True, if the task was started immediately. False, if the task will be executed later.
Deprecated:
No longer in use.

Definition at line 201 of file ThreadPool.java.

Returns the maximum number of concurrent threads.

Returns:
Maximum number of threads.

Definition at line 226 of file ThreadPool.java.

synchronized int org.apache.xmlrpc.util.ThreadPool.getNumThreads ( ) [inline]

Returns the number of threads, which have actually been created, as opposed to the number of currently running threads.

Definition at line 231 of file ThreadPool.java.

synchronized Poolable org.apache.xmlrpc.util.ThreadPool.getPoolable ( Task  pTask,
boolean  pQueue 
) [inline, private]

Definition at line 178 of file ThreadPool.java.

synchronized void org.apache.xmlrpc.util.ThreadPool.remove ( Poolable  pPoolable) [inline, private]

Definition at line 128 of file ThreadPool.java.

void org.apache.xmlrpc.util.ThreadPool.repool ( Poolable  pPoolable) [inline, package]

Definition at line 133 of file ThreadPool.java.

synchronized void org.apache.xmlrpc.util.ThreadPool.shutdown ( ) [inline]

Closes the pool.

Definition at line 212 of file ThreadPool.java.

Starts a task immediately.

Parameters:
pTaskThe task being started.
Returns:
True, if the task could be started immediately. False, if the maxmimum number of concurrent tasks was exceeded. If so, you might consider to use the addTask(ThreadPool.Task) method instead.

Definition at line 169 of file ThreadPool.java.


Member Data Documentation

Definition at line 112 of file ThreadPool.java.

Definition at line 116 of file ThreadPool.java.

final List org.apache.xmlrpc.util.ThreadPool.runningThreads = new ArrayList() [private]

Definition at line 114 of file ThreadPool.java.

final ThreadGroup org.apache.xmlrpc.util.ThreadPool.threadGroup [private]

Definition at line 111 of file ThreadPool.java.

final List org.apache.xmlrpc.util.ThreadPool.waitingTasks = new ArrayList() [private]

Definition at line 115 of file ThreadPool.java.

final List org.apache.xmlrpc.util.ThreadPool.waitingThreads = new ArrayList() [private]

Definition at line 113 of file ThreadPool.java.


The documentation for this class was generated from the following file:


rosjava_core
Author(s):
autogenerated on Wed Aug 26 2015 16:06:50