Package com.gigaspaces.lrmi
Class ConnectionPool
java.lang.Object
com.gigaspaces.lrmi.ConnectionPool
ConnectionPool for reuse of LRMI Connections (an LRMI Connection is abstracted by a Client Peer).
A Connection Pool facilitates the reuse of connections.
An Pooled Client Proxy makes use of a Connection Pool.
- Since:
- 4.0
- Author:
- Igor Goldenberg
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionPool(ProtocolAdapter protocolAdapter, ITransportConfig config, String connectionURL, PlatformLogicalVersion serviceVersion) Creates a new Connection Pool with the specified Protocol Adapter, connection URL and max connections. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voiddisable()voidenable()voidfreeConnection(ConnectionResource clientPeer) Free a connection (return it to pool).static LongAddergetConnection(LRMIMethod lrmiMethod) Returns a connected Client Peer from the pool.longlong
-
Constructor Details
-
ConnectionPool
public ConnectionPool(ProtocolAdapter protocolAdapter, ITransportConfig config, String connectionURL, PlatformLogicalVersion serviceVersion) Creates a new Connection Pool with the specified Protocol Adapter, connection URL and max connections.
-
-
Method Details
-
getActiveConnectionsCounter
-
getConnection
public ConnectionResource getConnection(LRMIMethod lrmiMethod) throws RemoteException, MalformedURLException Returns a connected Client Peer from the pool. If there is an un-used connection in the pool, it is returned; otherwise, a new connection is created and added to the pool. If the pool is full, the caller will be blocked until a free connection is available.- Throws:
RemoteExceptionMalformedURLException
-
freeConnection
Free a connection (return it to pool). -
getGeneratedTraffic
public long getGeneratedTraffic() -
getReceivedTraffic
public long getReceivedTraffic() -
disable
public void disable() -
enable
public void enable() -
getMonitoringDetails
-
close
public void close()
-