QuickServer
v1.4.5

org.quickserver.util.pool.thread
Class ClientPool

java.lang.Object
  extended byorg.quickserver.util.pool.thread.ClientPool

public class ClientPool
extends java.lang.Object

This is a class for managing the pool of threads for handling clients.

Since:
1.3
Author:
Akshathkumar Shetty

Field Summary
protected  java.util.List clients
           
protected  org.apache.commons.pool.ObjectPool pool
           
protected  PoolConfig poolConfig
           
 
Constructor Summary
ClientPool(org.apache.commons.pool.ObjectPool objectPool, PoolConfig poolConfig)
           
 
Method Summary
 void addClient(java.lang.Runnable r)
           
 void clear()
           
 void close()
           
protected  void finalize()
           
 java.util.Iterator getAllClientThread()
          Returns iterator containing all the active threads i.e ClientHandler handling connected clients.
 java.lang.Runnable getClient()
           
 int getNumActive()
          Return the number of instances currently borrowed from my pool.
 int getNumIdle()
          Return the number of instances currently idle in my pool.
 PoolConfig getPoolConfig()
          Returns PoolConfig object that configured this pool
 boolean isClientAvailable()
           
 void returnObject(java.lang.Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clients

protected java.util.List clients

pool

protected org.apache.commons.pool.ObjectPool pool

poolConfig

protected PoolConfig poolConfig
Constructor Detail

ClientPool

public ClientPool(org.apache.commons.pool.ObjectPool objectPool,
                  PoolConfig poolConfig)
Method Detail

addClient

public void addClient(java.lang.Runnable r)
               throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

returnObject

public void returnObject(java.lang.Object object)

getClient

public java.lang.Runnable getClient()

isClientAvailable

public boolean isClientAvailable()
Since:
1.4.5

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

close

public void close()
           throws java.lang.Exception
Throws:
java.lang.Exception

clear

public void clear()
           throws java.lang.Exception
Throws:
java.lang.Exception

getNumActive

public int getNumActive()
Return the number of instances currently borrowed from my pool.

Since:
1.4.1

getNumIdle

public int getNumIdle()
Return the number of instances currently idle in my pool.

Since:
1.4.1

getAllClientThread

public final java.util.Iterator getAllClientThread()
Returns iterator containing all the active threads i.e ClientHandler handling connected clients.

Since:
1.3.1

getPoolConfig

public PoolConfig getPoolConfig()
Returns PoolConfig object that configured this pool

Since:
1.4.5

QuickServer
v1.4.5

Copyright © 2003-2005 QuickServer.org