public class NioChannelDelegateInvocationHandler extends AutoCloseableDelegateInvocationHandler
Channel delegate into a proxy instance that closes both when wrapper
close method called. The Channel.isOpen() call is invoked only on the delegate| Constructor and Description |
|---|
NioChannelDelegateInvocationHandler(Object proxyTarget,
Channel delegate) |
| Modifier and Type | Method and Description |
|---|---|
Channel |
getChannelDelegate() |
Object |
invoke(Object proxy,
Method method,
Object[] args) |
static boolean |
isQueryOpenMethodInvocation(Method m) |
static boolean |
isQueryOpenMethodInvocation(Method m,
Object[] args) |
static <T extends Channel> |
wrapDelegateChannel(Object proxyTarget,
Class<T> type,
Channel delegate)
|
getAutoCloseableDelegate, getProxyTarget, isCloseMethod, isCloseMethodInvocation, wrapDelegateCloseablepublic Channel getChannelDelegate()
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke in interface InvocationHandlerinvoke in class AutoCloseableDelegateInvocationHandlerThrowablepublic static <T extends Channel> T wrapDelegateChannel(Object proxyTarget, Class<T> type, Channel delegate)
Channel delegate into a proxy instance that closes both when wrapper
close method called. The Channel.isOpen() call is invoked only on the delegateT - The generic Channel wrapping interfaceproxyTarget - 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 interfacedelegate - The (never null) delegate to use. Note: the delegate is closed after
the target instance.public static boolean isQueryOpenMethodInvocation(Method m, Object[] args)
public static boolean isQueryOpenMethodInvocation(Method m)
Copyright © 2018–2021 The Apache Software Foundation. All rights reserved.