Package ball.lang.reflect
Class FacadeProxyInvocationHandler
- java.lang.Object
-
- ball.lang.reflect.DefaultInvocationHandler
-
- ball.lang.reflect.FacadeProxyInvocationHandler
-
- All Implemented Interfaces:
DefaultInterfaceMethodInvocationHandler,InvocationHandler
- Direct Known Subclasses:
FluentNode.InvocationHandler
public abstract class FacadeProxyInvocationHandler extends DefaultInvocationHandler
InvocationHandlerabstract base class to "extend" concrete implementationClasses by adding "facade" interfaces. SeegetProxyClassFor(Object).- Author:
- Allen D. Ball
-
-
Constructor Summary
Constructors Constructor Description FacadeProxyInvocationHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Objectenhance(Object in)Method to return an extendedProxyimplementing "facade" interfaces forinifgetProxyClassFor(Object)returns non-null.protected abstract Class<?>getProxyClassFor(Object object)Objectinvoke(Object proxy, Method method, Object[] argv)If themethod.isDefault(), thatMethodwill be invoked directly.-
Methods inherited from class ball.lang.reflect.DefaultInvocationHandler
getImplementedInterfacesOf, getProxyClass, newProxyInstance
-
-
-
-
Constructor Detail
-
FacadeProxyInvocationHandler
public FacadeProxyInvocationHandler()
-
-
Method Detail
-
enhance
public Object enhance(Object in)
Method to return an extendedProxyimplementing "facade" interfaces forinifgetProxyClassFor(Object)returns non-null.- Parameters:
in- TheObjectto extend.- Returns:
- A
ProxyifgetProxyClassFor(Object)returns non-null;inotherwise.
-
getProxyClassFor
protected abstract Class<?> getProxyClassFor(Object object)
-
invoke
public Object invoke(Object proxy, Method method, Object[] argv) throws Throwable
Description copied from class:DefaultInvocationHandlerIf themethod.isDefault(), thatMethodwill be invoked directly. If theMethodis declared inObject, it is applied tothisInvocationHandler. Otherwise, the call will be dispatched to a declaredMethodonthisInvocationHandlerwith the same name and compatible parameter types (forcing access if necessary).- Specified by:
invokein interfaceDefaultInterfaceMethodInvocationHandler- Specified by:
invokein interfaceInvocationHandler- Overrides:
invokein classDefaultInvocationHandler- Parameters:
proxy- The proxy instance.method- TheMethod.argv- The argument array.- Returns:
- The value to return from the
Methodinvocation. - Throws:
Throwable
-
-