AutoCloseable delegate into a proxy instance that closes both when wrapper
close method called.
| Modifier and Type | Field and Description |
|---|---|
| private final Object[] | |
| private final AutoCloseable | |
| private final Object |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public AutoCloseable | |
| public Object | |
| public Object | invoke(Object
the proxy instance that the method was invoked on proxy, Method the method, Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. Processes a method invocation on a proxy instance and returns the result. |
| public static boolean | |
| public static boolean | |
| public static < The generic T extends AutoCloseable> TAutoCloseable wrapping interface | Returns: The wrapping proxyThe (never proxyTarget, Class<T> null) target instance - if not AutoCloseable then it's
close() method will not be invoked (i.e., only the delegate)The target wrapping interface type, AutoCloseable The (never delegate)null) delegate to closeNote the delegate is closed after the target instance. Wraps a target instance and an |
| closers | back to summary |
|---|---|
| private final Object[] closers | |
| delegate | back to summary |
|---|---|
| private final AutoCloseable delegate | |
| proxyTarget | back to summary |
|---|---|
| private final Object proxyTarget | |
| AutoCloseableDelegateInvocationHandler | back to summary |
|---|---|
| public AutoCloseableDelegateInvocationHandler(Object proxyTarget, AutoCloseable delegate) | |
| getAutoCloseableDelegate | back to summary |
|---|---|
| public AutoCloseable getAutoCloseableDelegate() | |
| getProxyTarget | back to summary |
|---|---|
| public Object getProxyTarget() | |
| invoke | back to summary |
|---|---|
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable Implements java. Doc from java. Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
| |
| isCloseMethod | back to summary |
|---|---|
| public static boolean isCloseMethod(Method m) | |
| isCloseMethodInvocation | back to summary |
|---|---|
| public static boolean isCloseMethodInvocation(Method m, Object[] args) | |
| wrapDelegateCloseable | back to summary |
|---|---|
| public static <T extends AutoCloseable> T wrapDelegateCloseable(Object proxyTarget, Class<T> type, AutoCloseable delegate) Wraps a target instance and an
| |