Package com.helger.commons.lang.proxy
Class LoggingInvocationHandler
- java.lang.Object
-
- com.helger.commons.lang.proxy.LoggingInvocationHandler
-
- All Implemented Interfaces:
InvocationHandler
public class LoggingInvocationHandler extends Object implements InvocationHandler
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_PROXY_RETURN_VALUES
-
Constructor Summary
Constructors Constructor Description LoggingInvocationHandler(Object aActualTarget)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectinvoke(Object aProxy, Method aMethod, Object[] aArgs)booleanisProxyReturnValues()static <T> Tproxying(Class<? extends T> aInterfaceClass, T aActualTarget)static <T> Tproxying(Class<? extends T> aInterfaceClass, T aActualTarget, Function<? super T,? extends InvocationHandler> aFactory)LoggingInvocationHandlersetProxyReturnValues(boolean bProxyReturnValues)
-
-
-
Field Detail
-
DEFAULT_PROXY_RETURN_VALUES
public static final boolean DEFAULT_PROXY_RETURN_VALUES
- See Also:
- Constant Field Values
-
-
Method Detail
-
isProxyReturnValues
public boolean isProxyReturnValues()
- Returns:
trueif return values are returned as proxied object (the default) orfalseif the proxied return values are returned "as-is".
-
setProxyReturnValues
@Nonnull public LoggingInvocationHandler setProxyReturnValues(boolean bProxyReturnValues)
- Parameters:
bProxyReturnValues-trueto enable automatic proxying of return values (if the declared return type is an interface; activated by default) orfalseto disable this feature.- Returns:
- this for chaining
-
invoke
@Nullable public Object invoke(@Nonnull Object aProxy, @Nonnull Method aMethod, @Nonnull Object[] aArgs) throws Throwable
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
proxying
@Nonnull public static <T> T proxying(@Nonnull Class<? extends T> aInterfaceClass, @Nonnull T aActualTarget)
-
-