public class ConnectionPluginManager
extends java.lang.Object
IConnectionPlugin for each connection.| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
DEFAULT_PLUGIN_FACTORIES |
protected IConnectionPlugin |
headPlugin |
protected static java.util.Queue<ConnectionPluginManager> |
instances |
protected Log |
logger |
protected PropertySet |
propertySet |
| Constructor and Description |
|---|
ConnectionPluginManager(Log logger) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
execute(java.lang.Class<?> methodInvokeOn,
java.lang.String methodName,
java.util.concurrent.Callable<?> executeSqlFunc)
Execute a JDBC method with the connection plugin chain.
|
void |
init(ClusterAwareConnectionProxy proxy,
PropertySet propertySet)
Initialize a chain of
IConnectionPlugin using their corresponding IConnectionPluginFactory. |
static void |
releaseAllResources()
Release all dangling resources for all connection plugin managers.
|
void |
releaseResources()
Release all dangling resources held by the connection plugins associated with
a single connection.
|
protected static final java.lang.String DEFAULT_PLUGIN_FACTORIES
protected static final java.util.Queue<ConnectionPluginManager> instances
protected Log logger
protected PropertySet propertySet
protected IConnectionPlugin headPlugin
public ConnectionPluginManager(Log logger)
public void init(ClusterAwareConnectionProxy proxy, PropertySet propertySet)
IConnectionPlugin using their corresponding IConnectionPluginFactory.
If PropertyKey.connectionPluginFactories is provided by the user, initialize
the chain with the given connection plugins in the order they are specified. Otherwise,
initialize the NodeMonitoringConnectionPlugin instead.
The DefaultConnectionPlugin will always be initialized and attached as the
last connection plugin in the chain.
proxy - The connection the plugins are associated with.propertySet - The configuration of the connection.public java.lang.Object execute(java.lang.Class<?> methodInvokeOn,
java.lang.String methodName,
java.util.concurrent.Callable<?> executeSqlFunc)
throws java.lang.Exception
methodInvokeOn - The Java Class invoking the JDBC method.methodName - The name of the method being invoked.executeSqlFunc - A lambda executing the method.java.lang.Exception - if errors occurred during the execution.public void releaseResources()
public static void releaseAllResources()