Note
the term borrowed here refers to connection references obtained
via org. for application usage.
| Modifier and Type | Field and Description |
|---|---|
| private final ConnectionManager | |
| private static final Class | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Connection | Returns: The generated proxy.The connection manager to wrap with the
connection proxy. connectionManager)Generates a Connection proxy wrapping the connection managed by the passed connection manager. |
| public static ClassLoader | Returns: The class loader appropriate for proxy construction.Determines the appropriate class loader to which the generated proxy should be scoped. |
| public static Connection | Returns: The unwrapped connection.The connection (proxy) to be unwrapped. connection)Convience method for unwrapping a connection proxy and getting a handle to an underlying connection. |
| public Object | invoke(Object
the proxy instance that the method was invoked on proxy, Method the method, Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. |
| public static void | renderUnuseable(Connection
The connection (proxy) to be marked. connection)Marks a borrowed connection as no longer usable. |
| connectionManager | back to summary |
|---|---|
| private final ConnectionManager connectionManager | |
| PROXY_INTERFACES | back to summary |
|---|---|
| private static final Class<T>[] PROXY_INTERFACES | |
| useable | back to summary |
|---|---|
| private boolean useable | |
| BorrowedConnectionProxy | back to summary |
|---|---|
| public BorrowedConnectionProxy(ConnectionManager connectionManager) | |
| generateProxy | back to summary |
|---|---|
| public static Connection generateProxy(ConnectionManager connectionManager) Generates a Connection proxy wrapping the connection managed by the passed connection manager.
| |
| getProxyClassLoader | back to summary |
|---|---|
| public static ClassLoader getProxyClassLoader() Determines the appropriate class loader to which the generated proxy should be scoped.
| |
| getWrappedConnection | back to summary |
|---|---|
| public static Connection getWrappedConnection(Connection connection) Convience method for unwrapping a connection proxy and getting a handle to an underlying connection.
| |
| invoke | back to summary |
|---|---|
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable Implements java. Doc from java. Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
| |
| renderUnuseable | back to summary |
|---|---|
| public static void renderUnuseable(Connection connection) Marks a borrowed connection as no longer usable.
| |