public class ClientPool<C,T>
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
clear()
Release/disconnect idle clients of all key groups.
|
void |
clear(java.lang.String key)
Release/disconnect idle clients of a key group.
|
void |
close()
Release/disconnect all clients of all key groups, close the pool.
|
int |
getActiveClientNumber(java.lang.String key)
Return the number of active clients of a key group
|
T |
getClient(java.lang.String key)
Get a client object which is idle from the pool.
|
int |
getIdleClientNumber(java.lang.String key)
Return the number of idle clients of a key group
|
int |
getTotalActiveClientNumber()
Return the number of active clients of all key group
|
int |
getTotalIdleClientNumber()
Return the number of idle clients of all key group
|
void |
returnClient(java.lang.String key,
T grpcClient)
Return a client object.
|
public T getClient(java.lang.String key)
key
- the key of a group where the client belongpublic void returnClient(java.lang.String key, T grpcClient)
key
- the key of a group where the client belonggrpcClient
- the client object to returnpublic void close()
public void clear()
public void clear(java.lang.String key)
key
- the key of a grouppublic int getIdleClientNumber(java.lang.String key)
key
- the key of a grouppublic int getActiveClientNumber(java.lang.String key)
key
- the key of a grouppublic int getTotalIdleClientNumber()
public int getTotalActiveClientNumber()