Package org.apache.commons.io.channels
Class CloseShieldChannelHandler
java.lang.Object
org.apache.commons.io.channels.CloseShieldChannelHandler
- All Implemented Interfaces:
InvocationHandler
An
InvocationHandler supporting the implementation of CloseShieldChannel.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ObjectinvokeObjectMethod(Object proxy, Method method, Object[] args) private static booleanisAllowedAfterClose(Class<?> declaringClass, String name, int parameterCount) Tests whether the given method is allowed to be called after the shield is closed.(package private) static booleanisSupported(Class<?> interfaceClass) private static booleanreturnsThis(Class<?> declaringClass, String name, int parameterCount) Tests whether the given method returns 'this' (the channel) as per JDK spec.
-
Field Details
-
SUPPORTED_INTERFACES
-
delegate
-
closed
private volatile boolean closed
-
-
Constructor Details
-
CloseShieldChannelHandler
CloseShieldChannelHandler(Channel delegate)
-
-
Method Details
-
isAllowedAfterClose
private static boolean isAllowedAfterClose(Class<?> declaringClass, String name, int parameterCount) Tests whether the given method is allowed to be called after the shield is closed.- Parameters:
declaringClass- The class declaring the method.name- The method name.parameterCount- The number of parameters.- Returns:
trueif the method is allowed afterclose(),falseotherwise.
-
isSupported
-
returnsThis
Tests whether the given method returns 'this' (the channel) as per JDK spec.- Parameters:
declaringClass- The class declaring the method.name- The method name.parameterCount- The number of parameters.- Returns:
trueif the method returns 'this',falseotherwise.
-
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
invokeObjectMethod
-