Class InvocationProxyFactory


  • public class InvocationProxyFactory
    extends Object
    Factory to create invocation proxies.

    Method calls to invocation proxies can be intercepted and modified by a chain of MethodInterceptors. Each MethodInterceptor can continue the call chain, terminate prematurely or modify all aspects of a Method invocation.

    InvocationProxyFactory produces invocation proxies which can implement multiple interface type. Any non-interface types are rejected.

    Since:
    5.0
    Author:
    Mark Paluch
    See Also:
    MethodInterceptor, MethodInvocation
    • Constructor Detail

      • InvocationProxyFactory

        public InvocationProxyFactory()
    • Method Detail

      • createProxy

        public <T> T createProxy​(ClassLoader classLoader)
        Create a proxy instance give a ClassLoader.
        Type Parameters:
        T - inferred result type.
        Parameters:
        classLoader - must not be null.
        Returns:
        the invocation proxy instance.
      • addInterface

        public void addInterface​(Class<?> ifc)
        Add a interface type that should be implemented by the resulting invocation proxy.
        Parameters:
        ifc - must not be null and must be an interface type.