Class NioChannelDelegateInvocationHandler

    • Constructor Detail

      • NioChannelDelegateInvocationHandler

        public NioChannelDelegateInvocationHandler​(Object proxyTarget,
                                                   Channel delegate)
    • Method Detail

      • getChannelDelegate

        public Channel getChannelDelegate()
      • wrapDelegateChannel

        public static <T extends Channel> T wrapDelegateChannel​(Object proxyTarget,
                                                                Class<T> type,
                                                                Channel delegate)
        Wraps a target instance and a Channel delegate into a proxy instance that closes both when wrapper close method called. The Channel.isOpen() call is invoked only on the delegate
        Type Parameters:
        T - The generic Channel wrapping interface
        Parameters:
        proxyTarget - The (never null) target instance - if not AutoCloseable then it's close() method will not be invoked (i.e., only the delegate)
        type - The target wrapping interface
        delegate - The (never null) delegate to use. Note: the delegate is closed after the target instance.
        Returns:
        The wrapping proxy
      • isQueryOpenMethodInvocation

        public static boolean isQueryOpenMethodInvocation​(Method m,
                                                          Object[] args)
      • isQueryOpenMethodInvocation

        public static boolean isQueryOpenMethodInvocation​(Method m)