com.mongodb.util
Class ThreadPool<T>

java.lang.Object
  extended by com.mongodb.util.ThreadPool<T>

Deprecated. This class is no longer in use and should not have been public. It may be removed in a future release.

@Deprecated
public abstract class ThreadPool<T>
extends Object

A thread pool implementation.


Constructor Summary
ThreadPool(String name, int numThreads)
          Deprecated. Initializes a new thread pool with a given name and number of threads.
ThreadPool(String name, int numThreads, int maxQueueSize)
          Deprecated. Initializes a new thread pool with a given name, number of threads, and queue size.
 
Method Summary
abstract  void handle(T t)
          Deprecated. Handles a given object.
abstract  void handleError(T t, Exception e)
          Deprecated. Handles a given object and exception.
 int inProgress()
          Deprecated.  
 int numThreads()
          Deprecated.  
 boolean offer(T t)
          Deprecated. Adds a new object to the pool, if possible.
 int queueSize()
          Deprecated. Returns the size of the pool's queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadPool

public ThreadPool(String name,
                  int numThreads)
Deprecated. 
Initializes a new thread pool with a given name and number of threads.

Parameters:
name - identifying name
numThreads - the number of threads allowed in the pool

ThreadPool

public ThreadPool(String name,
                  int numThreads,
                  int maxQueueSize)
Deprecated. 
Initializes a new thread pool with a given name, number of threads, and queue size.

Parameters:
name - identifying name
numThreads - the number of threads allowed in the pool
maxQueueSize - the size of the pool entry queue
Method Detail

handle

public abstract void handle(T t)
                     throws Exception
Deprecated. 
Handles a given object.

Parameters:
t - the object to handle
Throws:
Exception

handleError

public abstract void handleError(T t,
                                 Exception e)
Deprecated. 
Handles a given object and exception.

Parameters:
t - the object to handle
e - the exception to handle

queueSize

public int queueSize()
Deprecated. 
Returns the size of the pool's queue.

Returns:
pool size

offer

public boolean offer(T t)
Deprecated. 
Adds a new object to the pool, if possible.

Parameters:
t - the object to be added
Returns:
if the object was successfully added

inProgress

public int inProgress()
Deprecated. 

numThreads

public int numThreads()
Deprecated.