You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2018/12/16 19:16:00 UTC

[GitHub] reta commented on a change in pull request #482: [CXF-7926] Initial MP Rest Client 1.2 impl

reta 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_r241992385
 
 

 ##########
 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:
   Should we check if `SecurityManager` is present? 
   ```
   if (System.getSecurityManager() == null) {
     // non priviledged 
   } else {
     // priviledged 
   }
   ```
   Since most of the apps are run without `SecurityManager`, we could gain some efficiency here. What do you think?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services