@nacx so I didn't think of an easier way out before.

So, right now, there's an okhttp client provider, and this news up an 
OkHttpClient. As a last step, it configures it.

What if instead, OkHttpClientProvider used OkHttpClientSupplier first, as 
opposed to ConfigureOkHttpClient last? The interface would be much simpler.

```java
@ImplementedBy(NewOkHttpClient.class)
interface OkHttpClientSupplier {
  /** Returns a new instance, with any TLS configuration needed for all 
requests. */
  OkHttpClient get();

  static final class NewOkHttpClient implements OkHttpClientSupplier {
    public OkHttpClient get() {
      return new OkHttpClient();
    }
  }
}
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/619#issuecomment-65172414

Reply via email to