Package org.apache.iotdb.commons.client
Class ClientManager<K,V>
- java.lang.Object
-
- org.apache.iotdb.commons.client.ClientManager<K,V>
-
- All Implemented Interfaces:
IClientManager<K,V>
public class ClientManager<K,V> extends java.lang.Object implements IClientManager<K,V>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.iotdb.commons.client.IClientManager
IClientManager.Factory<K,V>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VborrowClient(K node)get a client V for node K from the IClientManager.voidclear(K node)clear all clients for node K.voidclose()close IClientManager, which means closing all clients for all nodes.org.apache.commons.pool2.KeyedObjectPool<K,V>getPool()voidreturnClient(K node, V client)return a client V for node K to the ClientManager.
-
-
-
Method Detail
-
borrowClient
public V borrowClient(K node) throws ClientManagerException
Description copied from interface:IClientManagerget a client V for node K from the IClientManager.- Specified by:
borrowClientin interfaceIClientManager<K,V>- Throws:
BorrowNullClientManagerException- if node is nullClientManagerException- for other exceptions
-
returnClient
public void returnClient(K node, V client)
return a client V for node K to the ClientManager.Note: We do not define this interface in IClientManager to make you aware that the return of a client is automatic whenever a particular client is used.
-
clear
public void clear(K node)
Description copied from interface:IClientManagerclear all clients for node K.- Specified by:
clearin interfaceIClientManager<K,V>
-
close
public void close()
Description copied from interface:IClientManagerclose IClientManager, which means closing all clients for all nodes.- Specified by:
closein interfaceIClientManager<K,V>
-
-