|
QuickServer v1.4.7 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.quickserver.util.pool.thread.ClientPool
This is a class for managing the pool of threads for handling clients.
Field Summary | |
protected java.util.List |
clients
|
protected org.apache.commons.pool.ObjectPool |
pool
|
protected PoolConfig |
poolConfig
|
Constructor Summary | |
ClientPool(QSObjectPool objectPool,
PoolConfig poolConfig)
|
Method Summary | |
void |
addClient(java.lang.Runnable r)
|
void |
addClient(java.lang.Runnable r,
boolean keepObjOnFail)
|
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 |
getMaxThreadsForNioWrite()
Returns the maximum threads allowed for nio write |
int |
getNumActive()
Return the number of instances currently borrowed from my pool. |
int |
getNumIdle()
Return the number of instances currently idle in my pool. |
org.apache.commons.pool.ObjectPool |
getObjectPool()
|
java.lang.Object |
getObjectToSynchronize()
|
PoolConfig |
getPoolConfig()
Returns PoolConfig object that configured this pool |
boolean |
isClientAvailable()
|
protected void |
nioWriteEnd()
Notifies when NIO write is complete. |
protected void |
nioWriteStart()
Notifies when NIO write is about to start. |
void |
returnObject(java.lang.Object object)
|
void |
setMaxThreadsForNioWrite(int count)
Sets the maximum threads allowed for nio write. |
boolean |
shouldNioWriteHappen()
Method to suggest if nio write should be sent for processing. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.List clients
protected org.apache.commons.pool.ObjectPool pool
protected PoolConfig poolConfig
Constructor Detail |
public ClientPool(QSObjectPool objectPool, PoolConfig poolConfig)
Method Detail |
public org.apache.commons.pool.ObjectPool getObjectPool()
public void addClient(java.lang.Runnable r) throws java.util.NoSuchElementException
java.util.NoSuchElementException
public void addClient(java.lang.Runnable r, boolean keepObjOnFail) throws java.util.NoSuchElementException
java.util.NoSuchElementException
public void returnObject(java.lang.Object object)
public java.lang.Runnable getClient()
public boolean isClientAvailable()
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
public void close() throws java.lang.Exception
java.lang.Exception
public void clear() throws java.lang.Exception
java.lang.Exception
public int getNumActive()
public int getNumIdle()
public final java.util.Iterator getAllClientThread()
public java.lang.Object getObjectToSynchronize()
public PoolConfig getPoolConfig()
public void setMaxThreadsForNioWrite(int count)
public int getMaxThreadsForNioWrite()
protected void nioWriteEnd()
protected void nioWriteStart()
public boolean shouldNioWriteHappen()
|
QuickServer v1.4.7 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |