Module org.mule.sdk.api
Package org.mule.sdk.api.connectivity
Interface PoolingConnectionProvider<C>
- Type Parameters:
C- the generic type of the connections to be handled
- All Superinterfaces:
ConnectionProvider<C>
A
ConnectionProvider specialization which pools connections.
This interface is declarative. The actual pooling is not implemented on the provider itself but performed by the runtime.
This interface also provides onBorrow(Object) and onReturn(Object) allowing to perform operations when a
connection is borrow and/or returned to the pool.
- Since:
- 1.0
-
Method Summary
Methods inherited from interface org.mule.sdk.api.connectivity.ConnectionProvider
connect, disconnect, validate
-
Method Details
-
onBorrow
Executes after theconnectionwas successfully borrowed from the pool but before it's handed over to the requester.This method can alter the state of the
connectionas long as it remains on a usable state.- Parameters:
connection- the pooled connection
-
onReturn
Executes right before the pool accepts theconnectionback.If this method throws exception, then the pool will invalidate the
connection. On the other hand, a successful execution of this method does not imply that the pool will successful accept the connection back. The pool is still free to invalidate the connection anyway.This method can alter the state of the
connectionas long as it remains on a usable state.- Parameters:
connection- the pooled connection
-