Class ORemoteConnectionPool
java.lang.Object
com.orientechnologies.orient.client.remote.ORemoteConnectionPool
- All Implemented Interfaces:
OResourcePoolListener<String,OChannelBinaryAsynchClient>
public class ORemoteConnectionPool
extends Object
implements OResourcePoolListener<String,OChannelBinaryAsynchClient>
Created by tglman on 01/10/15.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacquire(String iServerURL, long timeout, OContextConfiguration clientConfiguration) voidcheckIdle(long timeout) protected OChannelBinaryAsynchClientcreateNetworkConnection(String serverURL, OContextConfiguration clientConfiguration) createNewResource(String iKey, Object... iAdditionalArgs) Creates a new resource to be used and to be pooled when the client finishes with it.getPool()booleanreuseResource(String iKey, Object[] iAdditionalArgs, OChannelBinaryAsynchClient iValue) Reuses the pooled resource.
-
Constructor Details
-
ORemoteConnectionPool
public ORemoteConnectionPool(int iMaxResources)
-
-
Method Details
-
createNetworkConnection
protected OChannelBinaryAsynchClient createNetworkConnection(String serverURL, OContextConfiguration clientConfiguration) throws OIOException - Throws:
OIOException
-
createNewResource
Description copied from interface:OResourcePoolListenerCreates a new resource to be used and to be pooled when the client finishes with it.- Specified by:
createNewResourcein interfaceOResourcePoolListener<String,OChannelBinaryAsynchClient> - Returns:
- The new resource
-
reuseResource
public boolean reuseResource(String iKey, Object[] iAdditionalArgs, OChannelBinaryAsynchClient iValue) Description copied from interface:OResourcePoolListenerReuses the pooled resource.- Specified by:
reuseResourcein interfaceOResourcePoolListener<String,OChannelBinaryAsynchClient> - Returns:
- true if can be reused, otherwise false. In this case the resource will be removed from the pool
-
getPool
-
acquire
public OChannelBinaryAsynchClient acquire(String iServerURL, long timeout, OContextConfiguration clientConfiguration) -
checkIdle
public void checkIdle(long timeout)
-