Interface CompositeProxy.InvokeTunnel

Enclosing class:
CompositeProxy

public static interface CompositeProxy.InvokeTunnel
Invocation tunnel. Must be used when building a composite proxy from objects that implement package-private interfaces to prevent IllegalAccessException exceptions being thrown by Proxy instances. Must be implemented by classes from packages with package-private interfaces used with CompositeProxy class. Assumed implementation:

package org.foo;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import jdk.jpackage.internal.util.CompositeProxy;

final class CompositeProxyTunnel implements CompositeProxy.InvokeTunnel {

    @Override
    public Object invoke(Object obj, Method method, Object[] args) throws Throwable {
        return method.invoke(obj, args);
    }

    @Override
    public Object invokeDefault(Object proxy, Method method, Object[] args) throws Throwable {
        return InvocationHandler.invokeDefault(proxy, method, args);
    }

    static final CompositeProxyTunnel INSTANCE = new CompositeProxyTunnel();
}
  • Method Summary

    Modifier and Type
    Method
    Description
    invoke(Object obj, Method method, Object[] args)
    Processes a method invocation on an object of composite proxy and returns the result.
    invokeDefault(Object proxy, Method method, Object[] args)
    Processes a default interface method invocation on a composite proxy and returns the result.