public class BorrowedConnectionProxy extends Object implements InvocationHandler
Session.connection()
for application usage.Constructor and Description |
---|
BorrowedConnectionProxy(ConnectionManager connectionManager) |
Modifier and Type | Method and Description |
---|---|
static Connection |
generateProxy(ConnectionManager connectionManager)
Generates a Connection proxy wrapping the connection managed by the passed
connection manager.
|
static ClassLoader |
getProxyClassLoader()
Determines the appropriate class loader to which the generated proxy
should be scoped.
|
static Connection |
getWrappedConnection(Connection connection)
Convience method for unwrapping a connection proxy and getting a
handle to an underlying connection.
|
Object |
invoke(Object proxy,
Method method,
Object[] args) |
static void |
renderUnuseable(Connection connection)
Marks a borrowed connection as no longer usable.
|
public BorrowedConnectionProxy(ConnectionManager connectionManager)
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
Throwable
public static Connection generateProxy(ConnectionManager connectionManager)
connectionManager
- The connection manager to wrap with the
connection proxy.public static void renderUnuseable(Connection connection)
connection
- The connection (proxy) to be marked.public static Connection getWrappedConnection(Connection connection)
connection
- The connection (proxy) to be unwrapped.public static ClassLoader getProxyClassLoader()
Copyright © 2002-2017 Red Hat Middleware, LLC. All Rights Reserved