类 MultiHostConnectionProxy

    • 字段详细资料

      • lastExceptionDealtWith

        protected Throwable lastExceptionDealtWith
    • 方法详细资料

      • getProxy

        protected JdbcConnection getProxy()
        Get this connection's proxy. A multi-host connection may not be at top level in the multi-host connections chain. In such case the first connection in the chain is available as a proxy.
        返回:
        Returns this connection's proxy if there is one or itself if this is the first one.
      • getParentProxy

        protected JdbcConnection getParentProxy()
        Get this connection's parent proxy.
        返回:
        Returns this connection's proxy if there is one.
      • setProxy

        protected final void setProxy​(JdbcConnection proxyConn)
        Sets this connection's proxy. This proxy should be the first connection in the multi-host connections chain. After setting the connection proxy locally, propagates it through the dependent connections.
        参数:
        proxyConn - The top level connection in the multi-host connections chain.
      • propagateProxyDown

        protected void propagateProxyDown​(JdbcConnection proxyConn)
        Propagates the connection proxy down through the multi-host connections chain. This method is intended to be overridden in subclasses that manage more than one active connection at same time.
        参数:
        proxyConn - The top level connection in the multi-host connections chain.
      • invoke

        public Object invoke​(Object proxy,
                             Method method,
                             Object[] args)
                      throws Throwable
        Proxies method invocation on the java.sql.Connection interface, trapping multi-host specific methods and generic methods. Subclasses have to override this to complete the method invocation process, deal with exceptions and decide when to switch connection. To avoid unnecessary additional exception handling overriders should consult #canDealWith(Method) before chaining here.
        指定者:
        invoke 在接口中 InvocationHandler
        参数:
        proxy - proxy object
        method - method to invoke
        args - method parameters
        返回:
        method result
        抛出:
        Throwable - if an error occurs
      • allowedOnClosedConnection

        protected boolean allowedOnClosedConnection​(Method method)
        Checks if the given method is allowed on closed connections.
        参数:
        method - method
        返回:
        true if the given method is allowed on closed connections