Class NioChannelDelegateInvocationHandler
- java.lang.Object
-
- org.apache.sshd.common.util.closeable.AutoCloseableDelegateInvocationHandler
-
- org.apache.sshd.common.util.closeable.NioChannelDelegateInvocationHandler
-
- All Implemented Interfaces:
InvocationHandler
public class NioChannelDelegateInvocationHandler extends AutoCloseableDelegateInvocationHandler
Wraps a target instance and aChanneldelegate into a proxy instance that closes both when wrapperclosemethod called. TheChannel.isOpen()call is invoked only on the delegate- Author:
- Apache MINA SSHD Project
-
-
Constructor Summary
Constructors Constructor Description NioChannelDelegateInvocationHandler(Object proxyTarget, Channel delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelgetChannelDelegate()Objectinvoke(Object proxy, Method method, Object[] args)static booleanisQueryOpenMethodInvocation(Method m)static booleanisQueryOpenMethodInvocation(Method m, Object[] args)static <T extends Channel>
TwrapDelegateChannel(Object proxyTarget, Class<T> type, Channel delegate)-
Methods inherited from class org.apache.sshd.common.util.closeable.AutoCloseableDelegateInvocationHandler
getAutoCloseableDelegate, getProxyTarget, isCloseMethod, isCloseMethodInvocation, wrapDelegateCloseable
-
-
-
-
Method Detail
-
getChannelDelegate
public Channel getChannelDelegate()
-
invoke
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- Specified by:
invokein interfaceInvocationHandler- Overrides:
invokein classAutoCloseableDelegateInvocationHandler- Throws:
Throwable
-
wrapDelegateChannel
public static <T extends Channel> T wrapDelegateChannel(Object proxyTarget, Class<T> type, Channel delegate)
Wraps a target instance and aChanneldelegate into a proxy instance that closes both when wrapperclosemethod called. TheChannel.isOpen()call is invoked only on the delegate- Type Parameters:
T- The genericChannelwrapping interface- Parameters:
proxyTarget- The (nevernull) target instance - if notAutoCloseablethen it'sclose()method will not be invoked (i.e., only the delegate)type- The target wrapping interfacedelegate- The (nevernull) 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)
-
-