T - the generic type of the connection being wrapped by each individual instancepublic interface ConnectionHandler<T>
This is actually a wrapper which provides an unique API for managing connections of different
types and using different policies. For example, clients of this API will use the getConnection()
method to obtain the actual connection that's been managed, without independently of the connection
being pooled, cached, lazy, validated, reconnected, etc.
| Modifier and Type | Method and Description |
|---|---|
T |
getConnection()
Returns the connection that's being wrapped.
|
void |
release()
When a component requests an instance of this interface, it
becomes obligated to invoke this method after it no longer requires
such instance.
|
T getConnection() throws ConnectionException
No guarantees are offered regarding how this method provisions the connection.
The only commitment this method takes is that it will either provide a
connection ready to be used or throw a ConnectionException
ConnectionException - if a valid connection could not be obtainedvoid release()
Just like with getConnection(), the implications of executing
this method are not guaranteed. Depending on the implementation,
the connection could be closed, returned to a pooled, recycled, etc.
It is not to be assumed that any resources allocated by the wrapped connection
will be freed after invoking this method.
The only strong piece on the contract is the user's obligation to invoke this method once it's done with the instance
Copyright © 2017 MuleSoft, Inc.. All rights reserved.