Class NioChannelDelegateInvocationHandler
java.lang.Object
org.apache.sshd.common.util.closeable.AutoCloseableDelegateInvocationHandler
org.apache.sshd.common.util.closeable.NioChannelDelegateInvocationHandler
- All Implemented Interfaces:
InvocationHandler
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-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static boolean
isQueryOpenMethodInvocation
(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
-
Constructor Details
-
NioChannelDelegateInvocationHandler
-
-
Method Details
-
getChannelDelegate
-
invoke
- Specified by:
invoke
in interfaceInvocationHandler
- Overrides:
invoke
in classAutoCloseableDelegateInvocationHandler
- Throws:
Throwable
-
wrapDelegateChannel
public static <T extends Channel> T wrapDelegateChannel(Object proxyTarget, Class<T> type, Channel delegate) Wraps a target instance and aChannel
delegate into a proxy instance that closes both when wrapperclose
method called. TheChannel.isOpen()
call is invoked only on the delegate- Type Parameters:
T
- The genericChannel
wrapping interface- Parameters:
proxyTarget
- The (nevernull
) target instance - if notAutoCloseable
then 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
-
isQueryOpenMethodInvocation
-