public abstract class ConnectionWrapperFactory extends Object
Connection.close()
method.Modifier and Type | Class and Description |
---|---|
static interface |
ConnectionWrapperFactory.ConnectionCloseHandler
Interface defining an operation to close the wrapped connection
|
static class |
ConnectionWrapperFactory.NoOpCloseHandler
Implementation of ConnectionCloseHandler that does nothing on close or commit.
|
Modifier and Type | Method and Description |
---|---|
static <I> Connection |
wrap(Connection connection,
Class<I> wrapperInterface,
I wrapperHandler,
ConnectionWrapperFactory.ConnectionCloseHandler closeHandler)
Wrap the given
connection , creating a Proxy with an additional wrapperInterface
(implemented by given wrapperHandler ). |
static Connection |
wrap(Connection connection,
ConnectionWrapperFactory.ConnectionCloseHandler closeHandler)
Wrap the given
connection , creating a Proxy with an additional wrapperInterface
(implemented by given wrapperHandler ). |
public static <I> Connection wrap(Connection connection, Class<I> wrapperInterface, I wrapperHandler, ConnectionWrapperFactory.ConnectionCloseHandler closeHandler)
connection
, creating a Proxy with an additional wrapperInterface
(implemented by given wrapperHandler
). Calls to the close method are forwarded to the given
closeHandler
.
Note that all invocations on methods declared on the wrapperInterface
(including equals, hashCode)
are forwarded to the wrapperHandler
.I
- The type of additional interface for the wrapper to implementconnection
- The connection to wrapwrapperInterface
- The additional interface to implementwrapperHandler
- The implementation for the additional interfacecloseHandler
- The handler to redirect close invocations topublic static Connection wrap(Connection connection, ConnectionWrapperFactory.ConnectionCloseHandler closeHandler)
connection
, creating a Proxy with an additional wrapperInterface
(implemented by given wrapperHandler
). Calls to the close method are forwarded to the given
closeHandler
.connection
- The connection to wrapcloseHandler
- The handler to redirect close invocations toCopyright © 2010–2024. All rights reserved.