andymc12 commented on a change in pull request #482: [CXF-7926] Initial MP Rest
Client 1.2 impl
URL: https://github.com/apache/cxf/pull/482#discussion_r242191278
##########
File path:
rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java
##########
@@ -20,22 +20,56 @@
import java.net.URI;
import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Map;
import java.util.Objects;
+import java.util.Optional;
+import java.util.ServiceLoader;
+import java.util.WeakHashMap;
import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.ws.rs.core.Configurable;
import javax.ws.rs.core.Configuration;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.jaxrs.client.spec.ClientImpl;
+import org.apache.cxf.microprofile.client.config.ConfigFacade;
import org.eclipse.microprofile.rest.client.RestClientBuilder;
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
+import org.eclipse.microprofile.rest.client.spi.RestClientListener;
public class CxfTypeSafeClientBuilder implements RestClientBuilder,
Configurable<RestClientBuilder> {
+ private static final Logger LOG =
LogUtils.getL7dLogger(CxfTypeSafeClientBuilder.class);
+ private static final String REST_CONN_TIMEOUT_FORMAT =
"%s/mp-rest/connectTimeout";
+ private static final String REST_READ_TIMEOUT_FORMAT =
"%s/mp-rest/readTimeout";
+ private static final Map<ClassLoader, Collection<RestClientListener>>
REST_CLIENT_LISTENERS =
+ new WeakHashMap<>();
+
private String baseUri;
private ExecutorService executorService;
private final MicroProfileClientConfigurableImpl<RestClientBuilder>
configImpl =
new MicroProfileClientConfigurableImpl<>(this);
+ private static Collection<RestClientListener> listeners() {
+ ClassLoader threadContextClassLoader = AccessController.doPrivileged(
Review comment:
I agree. `ClassLoaderUtils` has a `getContextClassLoader` method that does
exactly that, but it is package protected. Do you think it would be ok to make
this method public and use it?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services