You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a static creator method modelled on the Util static methods to create a proxy, but with a Supplier<> instead of just a Map<String,String> to give me per request headers for things like tracing and auth...
private static <T> T createClientProxy(ClassLoader classLoader, Class<T> proxyInterface, final IJsonRpcClient client, final Supplier<Map<String, String>> perRequestHeaderSupplier) {
return (T) Proxy.newProxyInstance(classLoader, new Class<?>[]{proxyInterface}, (proxy, method, args) -> {
if (method.getDeclaringClass() == Object.class) return proxyObjectMethods(method, proxy, args);
final Object arguments = ReflectionUtil.parseArguments(method, args);
final String methodName = method.getName();
return client.invoke(methodName, arguments, method.getGenericReturnType(), perRequestHeaderSupplier.get());
});
}
The text was updated successfully, but these errors were encountered:
Hi There,
I added a static creator method modelled on the Util static methods to create a proxy, but with a Supplier<> instead of just a Map<String,String> to give me per request headers for things like tracing and auth...
The text was updated successfully, but these errors were encountered: