C - the generic type of the connections to be handled@MinMuleVersion(value="4.5") public interface PoolingConnectionProvider<C> extends ConnectionProvider<C>
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.
| Modifier and Type | Method and Description |
|---|---|
default void |
onBorrow(C connection)
Executes after the
connection was successfully borrowed from the pool but before it's handed over to the requester. |
default void |
onReturn(C connection)
Executes right before the pool accepts the
connection back. |
connect, disconnect, validatedefault void onBorrow(C connection)
connection was successfully borrowed from the pool but before it's handed over to the requester.
This method can alter the state of the connection as long as it remains on a usable state.
connection - the pooled connectiondefault void onReturn(C connection)
connection back.
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 connection as long as it remains on a usable state.
connection - the pooled connectionCopyright © 2023. All rights reserved.